0

table1:

tconst attr_a attr_b attr_c

table2:

tconst attr_d attr_e

What I want:

tconst attr_a attr_b attr_c attr_d attr_e

Note: The tconst in table1 and table2 are different numbers, no intersection

Could anyone help? Thanks!

1 Answer 1

1

You can try something like this, so that both statements in the union have the same number of columns:

select tconst , attr_a , attr_b , attr_c, null attr_d, null attr_e
from table1

union all

select tconst , null attr_a , null attr_b , null attr_c, attr_d, attr_e
from table2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.