Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to create query on query in MFC

How to create query on query in MFC

Scheduled Pinned Locked Moved Database
c++databasetutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    soundman32
    wrote on last edited by
    #1

    I would like to run a query on the results of a previous query. I know I can use SELECT in a SELECT, but the query I'm doing is not allowed to be a subquery (it's a TRANSFORM). I can run a query on a query from Access, I just want to do the same thing in MFC. Any ideas? Cheers Neil

    B 1 Reply Last reply
    0
    • S soundman32

      I would like to run a query on the results of a previous query. I know I can use SELECT in a SELECT, but the query I'm doing is not allowed to be a subquery (it's a TRANSFORM). I can run a query on a query from Access, I just want to do the same thing in MFC. Any ideas? Cheers Neil

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      A query on a query in SQL Server can be implemented in several ways: 1) create the initial query as a view and then query the view 2) insert the initial query results into a temp table and then query the temp table 3) create a table variable and insert the results of the initial query into the table variable. Then, run the second query using the table variable. 4).... and on and on limited only by your imagination and the specifics of your query(s).

      S M 2 Replies Last reply
      0
      • B basementman

        A query on a query in SQL Server can be implemented in several ways: 1) create the initial query as a view and then query the view 2) insert the initial query results into a temp table and then query the temp table 3) create a table variable and insert the results of the initial query into the table variable. Then, run the second query using the table variable. 4).... and on and on limited only by your imagination and the specifics of your query(s).

        S Offline
        S Offline
        soundman32
        wrote on last edited by
        #3

        Can you tell me how to do this on a TRANSFORM statement. As far as I can see, you can't TRANSFORM INTO a temp table. Maybe I'm wrong? Cheers Neil

        1 Reply Last reply
        0
        • B basementman

          A query on a query in SQL Server can be implemented in several ways: 1) create the initial query as a view and then query the view 2) insert the initial query results into a temp table and then query the temp table 3) create a table variable and insert the results of the initial query into the table variable. Then, run the second query using the table variable. 4).... and on and on limited only by your imagination and the specifics of your query(s).

          M Offline
          M Offline
          Mike Osbahr
          wrote on last edited by
          #4

          basementman wrote: A query on a query in SQL Server can be implemented in several ways: 1) create the initial query as a view and then query the view 2) insert the initial query results into a temp table and then query the temp table ... In .NET I've attempted to use method 2 and then define a data adapter to the stored procedure. The data adapter wizard gives me an error stating that the temporary table is not valid. Any idea how to make this work correctly? >>>-----> MikeO

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups