Skip to content
Advertisement

Results of an UNION in two columns

I am querying names from two tables:

And I get the result I want in a single column.

Now I want to know if it is possbile to get the results in two different columns like: "names_from_data1", "names_from_data2"

Or another way to identify where each name comes from: data_1 or data_2

Advertisement

Answer

You can add hardcoded column to indicate the source:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement