Subject | Re: [firebird-support] SQL |
---|---|
Author | Ann Harrison |
Post date | 2019-08-28T21:27:17Z |
> On Aug 28, 2019, at 12:54 AM, Kjell Rilbe kjell.rilbe@... [firebird-support] <firebird-support@yahoogroups.com> wrote:And will perform best. If both terms are indexed, Firebird will use both indexes.
>
> Den 2019-08-05 kl. 13:20, skrev mohamed hamza medhome@...
> [firebird-support]:
>>
>> Hi All,
>>
>> I am new to sql, I am coming from Xbase system .
>> I want to know if it 's possible to execute query using last query
>> result?
>>
>> EXAMPLE
>> 1 select * from persons where state='CA'
>>
>> 2 select * from persons where age> 18 but we have to use the
>> result of 1
>>
>> I DO NOT WANT TO DO AN AND ( STATE = 'CA' AND AGE > 18 ) ;
>
>
> First: Why not use and AND? That would be the most natural solution.
>Would a CTE work?
> Second: No, a plain sequence of SQL queries do not support that. But you
> can put them in a stored procedure or an "execute block" statement ...
Good luck,
Ann