题解 | #纠错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语句之后,因为对于结果集不存在对于一部分数据进行排序,而另一部分用另一种排序规则的情况。