Try:
SELECT Column1, Column 2, Column3
FROM Table1
UNION
SELECT Column1, Column2, 'MissingColumn'
FROM Table2
you can replace MissingColumn with any other string that you can then use to
determine where the information is coming from.
Marius Milosav
www.scorpiosoft.com
It's not about technology, it's about people.
Virtual Help Desk Demo (VHD)
www.scorpiosoft.com/vhd/login.cfm
----- Original Message -----
From: "Gene Kraybill" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, December 09, 2000 1:58 PM
Subject: OT: SQL Union
> I want to use the UNION operator to combine two SELECT statements. My
problem is
> that one of the SELECTs draws data that has one less column than the
other,
> because the table used in the second is missing one of the columns found
in the first.
> I'm trying to work out a way to create a dummy boolean column in the
second query
> and populate it with the value of 0, so the UNION operator works.
>
> Something like
>
> SELECT Column1, Column 2, Column3
> FROM Table1
> UNION
> SELECT Column1, Column2, 0 as Column3
> FROM Table2
>
> This doesn't work. What will?
>
> Gene Kraybill
>
> ---------------------------------
> Gene Kraybill
> LPW & Associates LLC
> www.lpw.net
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists