similarly (but different), mysql lets you do: (Select * from (Select * from openday where opendate > 21/06/06) where day = 'mon')
there is a similar feature in postgre, but i forget the exact syntax. the various engines differ in how the optimizers take advantage of the available indexes to maximize performance. regardless of the engine used, performance of the second query could be enhanced by sorting the first query on the second query's criteria, like: Select * from openday where opendate > 21/06/06 order by day; this will usually find the results for the second query sooner, and most "heavy" dbms will start returning the result set before the query is completed. performance may vary with different parameters, but it usually speeds things up more than it slows them down. [EMAIL PROTECTED] wrote: >> Date: Mon, 7 Aug 2006 13:36:11 +0100 >> From: "Chris Moore" <[EMAIL PROTECTED]> >> Subject: Multiple query >> To: "DelphiDB List" <delphi-db@elists.org> >> Message-ID: >> <[EMAIL PROTECTED]> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Group >> >> In any RDBMS it is possible to build a query, and then use >> that query as the basis of another query. >> >> Very simple example: >> open_d = (Select * from openday where opendate > 21/06/06) >> week_d = (Select * from open_d where day = 'mon') >> >> > Yes, > Oracle supports that type of construct. > Views are another way. > FWIW - I wouldn't run mission critical on MS Sql. > > Mick > > _______________________________________________ > Delphi-DB mailing list > Delphi-DB@elists.org > http://www.elists.org/mailman/listinfo/delphi-db > _______________________________________________ Delphi-DB mailing list Delphi-DB@elists.org http://www.elists.org/mailman/listinfo/delphi-db