首页 新闻 会员 周边

union的结果集,为什么不是第一个结果集的内容在前面

0
悬赏园豆:10 [已解决问题] 解决于 2015-06-30 16:13

具体的问题看截图吧!!!

select StationTitle from AkLineStation
inner join AkLineProcess on AkLineProcess.Id=AkLineStation.LineProcessId
where AkLineProcess.LineTitle='Line1' and AkLineStation.StationTitle='EL1-2'

select StationTitle from AkLineStation
inner join AkLineProcess on AkLineProcess.Id=AkLineStation.LineProcessId
where AkLineProcess.LineTitle='Line1' and lower(left(AkLineStation.StationTitle,2))='el' and AkLineStation.StationTitle<>'EL1-2'

select StationTitle from AkLineStation
inner join AkLineProcess on AkLineProcess.Id=AkLineStation.LineProcessId
where AkLineProcess.LineTitle='Line1' and AkLineStation.StationTitle='EL1-2'
union
select StationTitle from AkLineStation
inner join AkLineProcess on AkLineProcess.Id=AkLineStation.LineProcessId
where AkLineProcess.LineTitle='Line1' and lower(left(AkLineStation.StationTitle,2))='el' and AkLineStation.StationTitle<>'EL1-2'
View Code

凡一二三的主页 凡一二三 | 初学一级 | 园豆:85
提问于:2015-06-30 15:59
< >
分享
最佳答案
0

难道你没看出排序了吗?

收获园豆:5
爱编程的大叔 | 高人七级 |园豆:30839 | 2015-06-30 16:04
其他回答(1)
0

你需要union all。

收获园豆:5
幻天芒 | 园豆:37175 (高人七级) | 2015-06-30 16:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册