题解 | #纠错4#

纠错4

https://www.nowcoder.com/practice/bde1451b91084c8cab467387a0e0969c

SELECT cust_name,cust_contact,cust_email 
FROM Customers 
WHERE cust_state = 'MI' 
UNION 
SELECT cust_name,cust_contact,cust_email 
FROM Customers 
WHERE cust_state = 'IL'
ORDER BY cust_name;

使用union组合查询时,只能使用一条order by字句,他必须位于最后一条select语句之后,因为对于结果集不存在对于一部分数据进行排序,而另一部分用另一种排序规则的情况。

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务