Subject | Re: [firebird-support] Problem with using string operator in UNION? |
---|---|
Author | Martijn Tonies |
Post date | 2004-09-09T18:28:14Z |
Hi,
varchar(enter_nr_of_characters_here) ) as Root_Node,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> Is there any way to do a UNION and use the string operator || ?Sure.
> I found another way to do this. Its just to fill a combobox, but stillcast ((v1.ml_item || '/' || v2.ml_item) as
> wondering why the problem.
>
> Each half of the UNION works fine on its own.
>
> I keep getting
> SQL error code -104
> Invalid command
> Data type unknown
>
> for the following (its the field with || in it)
>
> select v1.ml_item || '/' || v2.ml_item as Root_Node ,
varchar(enter_nr_of_characters_here) ) as Root_Node,
> v1.ml_id as id,cast ((v3.ml_item || '/') as varchar(same_nr_as_above) ) as Root_Node,
> v2.ml_parentid ,
> v1.root_id
> from masterlibrary v1, masterlibrary v2
> where v1.root_id = v2.ml_parentid
> and v1.ml_parentid = -1
> UNION
> select as Root_Node ,
> v3.ml_id as id,With regards,
> v3.ml_parentid ,
> v3.root_id
> from masterlibrary v3
> where v3.ml_id = v3.root_id
> order by 1
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com