最佳答案
你可以使用UNION ALL
:
select category,
item
from test
where category is not null
union all
select category2 as category,
item
from test
where category2 is not null
order by item
Demo
关于数据库;来自不同类别的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43950108/