Adding Field to Query

David44Coder

Member
Local time
Tomorrow, 01:30
Joined
May 20, 2022
Messages
137
I have made a Union query showing various fields from 4 different tables
Is it possible to add a field showing the Names of each table into just the query? That is without adding a Name field into each table ?
 
Sure. You can add each table name as a constant field into the query.

SQL:
SELECT *, 'Table1' AS SourceTable FROM Table1
UNION
SELECT *, 'Table2' AS SourceTable FROM Table2
 

Users who are viewing this thread

Back
Top Bottom