L Xandor L Xandor - 3 months ago 10
SQL Question

Oracle SQL combine output from two queries into single output

I am not able to create tables, but I want to combine the output from two queries into a single output. What I currently have

Output 1:

Date Promo Count
1-Aug PROMO1 8
1-Aug PROMO2 3
2-Aug PROMO1 3
2-Aug PROMO2 4


Output 2:

Date Promo Count
1-Aug DIFFERENTKINDOFPROMO1 3
2-Aug DIFFERENTKINDOFPROMO1 5


What I'm trying to get (combine Output 1 and 2)

Date Promo Count

1-Aug PROMO1 8
1-Aug PROMO2 3
1-Aug DIFFERENTKINDOFPROMO1 3
2-Aug PROMO1 3
2-Aug PROMO2 4
2-Aug DIFFERENTKINDOFPROMO1 5


As mentioned, I don't have the ability to create any tables, so I'm trying to do this on the fly so I get the final combined output.

Answer
select * from table1
union all
select * from table2;