Subject Re: UNION [ALL] Error Question
Author february1874
I have just tried it and still the same error.... strange.

What I did in the interim now was to create a stored proc with
consecutive for..select queries to produce the result set.

By the way, I am using FB1.5 RC5 (have not yet tried on FB103)



--- In firebird-support@yahoogroups.com, Milan Babuskov <albis@e...>
wrote:
> february1874 wrote:
> > Why would this query:
> > -----------------------------------------------
> > SELECT S.*
> > FROM SIMULATOR S
> > WHERE S.ClientID=13 AND (S.recordType=0) OR (S.recordType=2) OR
> > (S.recordType=100)
> >
> > UNION ALL
> >
> > SELECT S.*
> > FROM SIMULATOR S
> > WHERE S.ClientID=13 AND (S.recordType=0)
> > --------------------------------------------
> >
> > produce the error
> > ------------------------
> > ISC ERROR MESSAGE:
> > Dynamic SQL Error
> > SQL error code = -104
> > Invalid command
> > count of column list and variable list do not match
> > ---------------------
>
> Have you tried to name all columns in both queries, like:
> SELECT s.ClientID, s.RecordType, ...
>
> My guess is that when you write S.* the column order is not
determined,
> so you can get unpredictable results (different column order in
queries).
>
> --
> Milan Babuskov
> http://fbexport.sourceforge.net