Union query quest (!)

Geordie2008

Registered User.
Local time
Today, 23:24
Joined
Mar 25, 2008
Messages
177
Hi all,

I have 2x tables:

Tbl_Main_Staff_Details
Tbl_MAIN_Staff_Details_HISTORY

The "history" table has 1 more column than the "Details" table (its the 1st column where I need the dummy field)

How can I dummy a column (called New_ID) within the sql so that I can union them? Other than this first column the tables are IDENTICAL (names / order etc)

Current code is:
SELECT * FROM Tbl_MAIN_Staff_Details
UNION SELECT * FROM Tbl_MAIN_Staff_Details_HISTORY;

Thanks!
Mand.
 
SELECT 0 as New_ID, * FROM Tbl_MAIN_Staff_Details
UNION SELECT * FROM Tbl_MAIN_Staff_Details_HISTORY;

??

It works exactly the same as a normal query... when you want to insert some (calculated value)
 
Ah ok....

You learn sumthing new every day!

Thanks,
Mandy
 

Users who are viewing this thread

Back
Top Bottom