Subject SV: [firebird-support] Union
Author Datatal AB - Gauffin, Jonas
lo. nope. not working. Im doing my college assigment. working (fulltime) and going to college (75% of normal time) =)

your suggestion doesnt work :(

-----Ursprungligt meddelande-----
Från: Martijn Tonies [mailto:m.tonies@...]
Skickat: sö 2003-09-14 14:31
Till: firebird-support@yahoogroups.com
Kopia:
Ämne: Re: [firebird-support] Union



Hi Jonas,

Working on a Sunday?

> If I run each query seperatly everything works. If i put then in a union,
it fails. How do I fix it?
>
> select 'förste kapten', fornamn, efternamn
> from flight_rutt fr
> inner join anstalld a ON (a.anstnr=fr.kapten1)
> where flightnr = 'SK405'
> UNION
> select 'andre kapten', fornamn, efternamn
> from flight_rutt fr
> inner join anstalld a ON (a.anstnr=fr.kapten2)
> where flightnr = 'SK405'
> UNION
> select 'vardinna', fornamn, efternamn
> from flight_vardinna fv
> inner join anstalld a ON (a.anstnr=fv.anstnr)
> where flightnr = 'SK405';

The problem is that Firebird cannot "figure out" a datatype for your 'forste
kapten' column -

Try this:

SELECT ('förste kapten' AS VARCHAR(15)), fornamn, efternamn ...

UNION

SELECT (CAST 'andre kapten' AS VARCHAR(15)), fornamn, efternamn ...

UNION

SELECT (CAST 'vardinna' AS VARCHAR(15)), fornamn, efternamn ...




With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-Bit SSL Security!
http://us.click.yahoo.com/p7cEmB/s7qGAA/yigFAA/67folB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



{src.d



[Non-text portions of this message have been removed]