Subject Re: [firebird-support] Problem with 'UNION ALL'
Author Lester Caine
Dimitry Sibiryakov wrote:
>> SELECT 'OBJE' AS type, COUNT(*) AS num FROM pgv_media WHERE m_gedfile=1
>> GROUP BY type
>> I'm only getting 4 results rather than the 5 expected, and strapping a
>> SELECT type, num FROM () around it does not help.
> It is simple: your "group by" affects not UNION as whole, but only to
> the last query, causing it to return no rows. Perhaps, there is no
> records with m_gedfile=1 in pgv_media.

Actually that was a remnant of another row! But it was just the sanity
check I needed.
The SQL *IS* fine. It *IS* the PDO:firebird driver that is at fault!

I'd bypassed the check when the target database was empty, and now that
there is data in there, the SQL is giving the right numbers, so now I
need to find out why 'PDO:fetch' is crashing apache ....

Lester Caine - G8HFL
Contact -
L.S.Caine Electronic Services -
EnquirySolve -
Model Engineers Digital Workshop -
Firebird -