Oracle SQL: Merge select results on top of each other

Viewed 992

Lets say you have two queries. Query A results in:

  | A | B | C |
  +---+---+---+
  | 1 | 5 | 9 |
  | 2 | 6 | 10|

And Query B results in:

  | A | B | C |
  +---+---+---+
  | 3 | 7 | 11|
  | 4 | 8 | 12|

Is it possible to execute the statements in a way to get:

  | A | B | C |
  +---+---+---+
  | 1 | 5 | 9 |
  | 2 | 6 | 10|
  | 3 | 7 | 11|
  | 4 | 8 | 12|

Would the simpler solution be to join them? Or if it involves using ';' to separate the two selects I'm getting an error using it.

Also, I have tried using UNION or UNION ALL between the statements but that gives

ORA-00933: SQL command not properly ended

This is being done in Excel's Microsoft query.

1 Answers
Related