mouse88
05-06-2009, 12:40 PM
I have the following sql statement:
SELECT * FROM Autoglass UNION ALL SELECT * FROM AutoscreenNetwork UNION ALL SELECT * FROM Autowindscreens UNION ALL SELECT * FROM Glasscare UNION ALL SELECT * FROM MobileWindscreens UNION ALL SELECT * FROM NationalWindscreens
This just unions all records from all tables, however what im looking to do is have a column added to the result table which will contain the name of the table each record came from.
Is this possible?
Appreciate any help
SELECT * FROM Autoglass UNION ALL SELECT * FROM AutoscreenNetwork UNION ALL SELECT * FROM Autowindscreens UNION ALL SELECT * FROM Glasscare UNION ALL SELECT * FROM MobileWindscreens UNION ALL SELECT * FROM NationalWindscreens
This just unions all records from all tables, however what im looking to do is have a column added to the result table which will contain the name of the table each record came from.
Is this possible?
Appreciate any help