Subject | Re: Using unions |
---|---|
Author | rajsubramani |
Post date | 2004-02-04T09:24:01Z |
--- In firebird-support@yahoogroups.com, Aage Johansen <aagjohan@o...>
wrote:
know how to transalate your suggestions to sql.
1. Since condition is Blob sub type 1, how will the type cast look
like in the sql statement.
2. Will the UNION not work if aliases are not used in the joins?
3. Again I do not understand this, some sql example will be useful.
Your help id much appreciated.
Cheers
-raj
wrote:
> On Tue, 3 Feb 2004 20:19:46 +0000 (UTC), rajsubramani wrote:Thanks for the reply, Aage. However, pardon my ignorance, I don not
>
> > 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)
know how to transalate your suggestions to sql.
1. Since condition is Blob sub type 1, how will the type cast look
like in the sql statement.
2. Will the UNION not work if aliases are not used in the joins?
3. Again I do not understand this, some sql example will be useful.
Your help id much appreciated.
Cheers
-raj