Skip to content
Advertisement

SQL UNION Query with Extra uncommon Field in Results

I have Four table, Now I display four common field using UNION sql query.

Question : I want to display one uncommon field ( Company ) which in table name as Multiple Product with current result.How can I do it ?

Current SQL :

Advertisement

Answer

You can just add an empty (or NULL) field to the other SELECT queries in the space where you want to return the Company field.

Note that you only need column aliases on the first SELECT.

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