Skip to content
Advertisement

How can I join result from two queries

So sorry but I am new to SQL querying and could use a little help.

I will like to join results from 2 tables and I can’t seem to get it return results I need.

Query 1

Query 2

I tried using union all but I get an error must have equal number of expressions in their target lists.

Any assistance will be appreciated.

Advertisement

Answer

When using an union, both queries must have the same number of fields in the select statements. Query 1 has 7 items while query 2 has 6. You can add a null value to query 2.

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