我有一个包含以下列的表
PAX_NO | AMOUNT_ONE | AMOUNT_TWO | PAX_NO_LASTYEAR | AMOUNT_ONE_LASTYEAR | AMOUNT_TWO_LASTYEAR
45 | 56.54 | 43.23 | 23 | 23.43 | 78.43
69 | 21.11 | 51.19 | 20 | 11.23 | 55.99
我需要按以下方式获取
PAX_NO | AMOUNT_ONE | AMOUNT_TWO
45 | 56.54 | 43.23
23 | 23.43 | 78.43
69 | 21.11 | 51.19
20 | 11.23 | 55.99
答案 0 :(得分:4)
您可以使用UNION ALL
:
SELECT pax_no, amount_one, amount_two FROM your_table
UNION ALL
SELECT PAX_NO_LASTYEAR, AMOUNT_ONE_LASTYEAR, AMOUNT_TWO_LASTYEAR FROM your_table;