Subject | Re: How many Unions allowed in firebird Select? |
---|---|
Author | Tony Masefield |
Post date | 2005-11-05T19:33:31Z |
--- In firebird-support@yahoogroups.com, Daniel Rail <daniel@a...>
wrote:
columns) works for AVG(). Had assumed that the conversion would have
been automatic (mistake).
Strangely enough, Count and Sum also give the same error (assuming the
first two selects are Min and Max) as AVG which threw me off - Can't
understand why - assume the internal data structures must be different
between, Max, Min, Avg, Count and Sum.
I suppose the moral is "When in doubt Cast"?
Regards,
wrote:
>Thank you Daniel - 100% correct. Using a Cast (to smallint - same as
> You say that when doing a union with the first two works. But what
> happens that you forget the first union and only union the last two
> selects(i.e. MAX with AVG)? Do you get the same error? And, if you
> do, try casting AVG as the same datatype as the column.
>
columns) works for AVG(). Had assumed that the conversion would have
been automatic (mistake).
Strangely enough, Count and Sum also give the same error (assuming the
first two selects are Min and Max) as AVG which threw me off - Can't
understand why - assume the internal data structures must be different
between, Max, Min, Avg, Count and Sum.
I suppose the moral is "When in doubt Cast"?
Regards,