How to create query on query in MFC
-
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
-
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
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).
-
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).
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
-
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).
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