Hello again, OK I know that I can create views in a RDBMS and then use them from D7. I don't want to do that.
I want to create in D7 (not the RDBMS) a query (view, select, whatever, nomenclature is a bitch), then base another D7 query on the results of the first D7 query. The RDBMS remains unchanged, I have created no views, queries, selects or tables in the RDBMS. Imagine that I am creating a generic SQLator, and that I have no idea what RDBMS the queries will be aimed at. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Price Sent: 07 August 2006 17:14 To: Moderated discussion list about database programming with Borland's Delphi Subject: Re: Multiple query Hi Chris, Yes, normally most Relational Databases which are things like Interbase, Firebird, SQL, MySQL, etc call this type of thing a View. It isn't something you normally do in Delphi itself, although you may find you are able to create the view from Delphi in one command, and then use another query to select against that View name, which acts much like the table name in a normal select. View: open_d Select * from openday where opendate > 21/06/06 Query: Select * from open_d where day = 'mon' You define your View with the base query, and then issue another query against the View itself to further refine your results. :) I hope that helps. Kind regards, Scott :) Chris Moore wrote: > 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') > > NB this is an EXAMPLE I have no interest in sorting anything by dates, > I just want information about the principle. > > Is it possible to do this in Delphi 7? > > Create a query, than use the results of that query as the basis of another? > > IE: (I know this won't work, is there a way of making this work?) > myquery1:=tadoquery.create myquery1.sql.add('sql stuff') > myquery1.active:=true > > myquery2:=tadoquery.create > myquery2.sql.add('select * from myquery1') myquery2.active:=true > > As ever - TIA - Chris > > Chris Moore > Computer Department > > Brother Industries (UK) Ltd > > > > > _______________________________________________ > 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 _______________________________________________ Delphi-DB mailing list Delphi-DB@elists.org http://www.elists.org/mailman/listinfo/delphi-db