|Subject||Re: [firebird-support] SQL|
> On Aug 28, 2019, at 12:54 AM, Kjell Rilbe kjell.rilbe@... [firebird-support] <email@example.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@...
>> 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
>> 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 ...