I need to select rows from 2 tables but not to join them (I need to append one to the other), I want to select them as if I selected them from the first, then selected them from the second, and do an ORDER BY then a LIMIT.
For example, 2 tables (and their columns):
- cats (name, age, grade)
- dogs (name, race, speed, grade)
I need to select the dogs and cats sorted by their grade. Something like:
Code: Select all
SELECT name FROM (cats + dogs) ORDER BY grade DESC LIMIT 10;