Subject Re: [firebird-support] Union Issue
Author Jonathan Neve
Helen Borrie wrote:

>At 04:04 PM 21/10/2003 +0000, you wrote:
>
>
>>This query works fine on by DB:
>>
>>select pensionPlan_ID from DB union
>>select pensionPlan_ID from DC
>>
>>but this one does not:
>>
>>select * from PensionPlans where PensionPland_Id in
>>(select pensionPlan_ID from DB union
>>select pensionPlan_ID from DC)
>>
>>It does not like the word 'union'
>>
>>
>
>Nope. Subqueries must return scalar output (one row, one column) and a
>union is by nature 2 or more rows ---> so verboten.
>
>
One column, yes. But surely not one row. It depends on the context. In
this context, what's to stop me doing :

select * from PensionPlans where PensionPland_Id in (select pensionPlan_ID from DB);

Without a UNION, this sort of thing works fine, I do it all the time.

Jonathan Neve.



[Non-text portions of this message have been removed]