Subject Re: [firebird-support] Re: union all and group by
Author Svein Erling Tysvaer
No, this gives the wrong result for any column that has more than one
column in both tablea and tableb. Running your query on his test data, I
got this result:

FOR1 30 10
FOR2 40 12
FOR3 60 2

whereas he wanted:

FOR1 30 10
FOR2 20 6
FOR3 60 2

Set

Dimitry Sibiryakov wrote:
>> with ta as
>
> May be "with" is overhead and he just need
>
> select tablea.cola1 as col1, sum(tablea.cola2) as total1,
> sum(tableb.colb2) as total2
> from tablea full join tableb on tablea.cola1=tableb.colb1
>
> SY, SD.