Hi, Seems like temporary result set does not exist or at least nobody seems heard about it. On second thought, I think Fabiano´s suggestion is workable for me because in the application, previous query could be saved (the one inside parentheses) and then add the outer select -subsequent query-. This solution would not require parsing. Also, I found something about CTE and derived queries in firebird documentation that I have to check. Thanks, Hector Rios
________________________________ From: Andrea Raimondi <[email protected]> To: [email protected] Sent: Saturday, September 22, 2012 12:06 AM Subject: Re: RES: [firebird-support] How to make queries to a temporary result set I am not 100% sure about this, but I think Firebird supports temporary tables. You might try with that... On Sep 22, 2012 1:41 AM, "HECTOR RIOS" <mailto:scadcam2004%40yahoo.com> wrote: > > Hi Fabiano, > > I was thinking more like this: > > 1. User wants bills from client x and program makes a > > select * from clients where name= x > > 2. Program displays x bills in some grid. > > 3. Later on, user wants x bills from march and I would like to make a query in program like this > > select * from lastResultSet where moth(bill_date) = 'march' > > of course, in this particular example, I could have made a query like > > select * from clients where name= x and month(bill_date)= 'march' > > but sometimes the second query is not added so easily, you would have to make some parsing to mix both queries. > It would be a lot easier if there were some temporary result set and apply filters to this temporary. > > Regards, > > Hector Rios > > > ________________________________ > From: Fabiano <mailto:fabianoaspro%40gmail.com> > To: mailto:firebird-support%40yahoogroups.com > Sent: Friday, September 21, 2012 1:26 PM > Subject: RES: [firebird-support] How to make queries to a temporary result set > > > > > > Maybe: > > Select * from > > ( > > select * from table where field1 = 1 > > ) as FILTER > > Where FILTER.field2 = 2 > > Fabiano. > > [Non-text portions of this message have been removed] > > > > > [Non-text portions of this message have been removed] > > > > ------------------------------------ > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > Visit http://www.firebirdsql.org/ and click the Resources item > on the main (top) menu. Try Knowledgebase and FAQ links ! > > Also search the knowledgebases at http://www.ibphoenix.com/ > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Yahoo! Groups Links > > > [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
