Subject | Re: [firebird-support] Syntax for Union |
---|---|
Author | Helen Borrie |
Post date | 2004-06-24T14:56:05Z |
At 10:41 AM 24/06/2004 -0400, you wrote:
where Field3 = 'T'
union
select Field1, Field2 from table2
order by 2
/heLen
>Hi All,select Field1, Field2 AS Name from table1
>
>I need some help with unions.
>
>select Field1, Field2 from table1
>union
>select Field1, Field2 from table2
>
>This works fine but I need to use the order by and where clauses on the
>first table. Something I read suggested this.
>
>(select t1.Field1, t1.Field2 AS Name from table1 t1
>union
>select t2.Field1, t2.Field2 AS Name from table2 t2)
>where t1.Field3 = 'T'
>order by Name
>
>But this barfs on the initial '('. Can someone give me an example of a
>union which can have where and order by clauses for the unioned tables?
where Field3 = 'T'
union
select Field1, Field2 from table2
order by 2
/heLen