Union query

ChristopherL

Registered User.
Local time
Today, 02:18
Joined
Jul 2, 2013
Messages
90
Hi there!

I am working with some unions that I have a question.
I have 5 queries that I would like to union, 2 of these are missing one column.
That way they can not be unioned, my question is if there is a way to "cheat" through this?

Making a short example here..

3 queries have

ID------PF_ID-------DATE

2 queries have
ID------DATE

Is there a way to union them?

The tables are linked, I can not adjust the fields or leave out PF_ID..
I was thinking if it could just leave it blank for the 2 tables without a PF_ID column or something..



Sorry for long post, I am quite bad at explaining my problems :D
 
SELECT ID, Null As PF_ID, DATE
FROM ...
 
can you not just put

"" AS PF_ID

or

0 AS PF_ID

or


Null AS PF_ID

or something similar into the union part of the tables that don't have a PF_ID?
 

Users who are viewing this thread

Back
Top Bottom