Re: Query based on the results of another query?



Bill,

Thank you for the reply.

I should have given a bit more explanation. The ADO query1 record set has
already been selected and edited by the user. I was hoping that there would
be a way to use the already selected query1 record set without having to
issue a select on it again.

Something along the lines of:

Query1,SQL[0] :='SELECT * FROM table WHERE whatever';
Query1.Open;
..
Some code to execute here (i.e. possible updates by the user on query1)
..
QueryView,SQL[0] :='SELECT * FROM View WHERE OrderId IN
(Query1.Recordset???)

or would it be smarter to just redo the select on query1 as per your first
example? I was wondering if by doing the select on query1 again I would be
creating unnecessary network traffic and/or creating additional database
work on the server. (BTW, I am using SQL Server 2005 and Delphi 2006.)

Thanks again,
Dave.


"Bill Todd" <no@xxxxxx> wrote in message
news:475ad480$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Select *
From View
Where OrderId IN (SELECT OrderId FROM ...)

--
Bill Todd (TeamB)



.