I have the following sql statement:
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
Code:
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