In SQL stesso puoi farlo usando UNION
. E usa ORDER BY
per l'intera domanda!
SELECT `title1` AS `title`, `type`
FROM `table`
UNION
SELECT `title2` AS `title`, `type`
FROM `table`
ORDER BY `title` ASC
Uscita
+-------+------+
| TITLE | TYPE |
+-------+------+
| asd1 | 7 |
| asd2 | 7 |
| qwe1 | 3 |
| qwe2 | 3 |
+-------+------+