2017-04-21 45 views

回答

7

您可以使用union all。如果您关心订购:

select id, x 
from ((select id, x, 1 as n from t) union all 
     (select id, y, 2 as n from t) 
    ) xy 
order by id, n; 

如果您不关心订购,那么union all就足够了。

+0

非常感谢。适用于我 –