Subject Re: [firebird-support] Using unions
Author Aage Johansen
On Tue, 3 Feb 2004 20:19:46 +0000 (UTC), rajsubramani wrote:

> I'm using firebird 1.0.
>
> When I try to do
>
> select book_id, price, '' as condition
> from Book
> UNION
> select bk.book_id, price, condition
> from Stock sk, Book bk where
> bk.book_id = sk.book_id
>
> I keep getting
> SQL error code = -104
> Invalid command
> Data type unknown
>



The type of the empty string ('') is different from "condition".

1. Cast the '' to the type of "condition"
2. Use aliases always when doing joins
3. Use explicit joins (don't do it in the WHERE clause)


--
Aage J.