You are already querying this table. For example: - table1 and table2
This way you can basically print the table name as the string itself -
SELECT 'table1' as tableName, text from table1 UNION SELECT 'table2' as tableName, text from table2 ORDER BY date
source share