题解 | #组合#

组合 Products 表中的产品名称和 Customers 表中的顾客名称

https://www.nowcoder.com/practice/461077c0ba0f473abecf5ee79c632acd

UNION和ORDER BY

链接

union在没有括号的情况下只能使用一个order by——意思就是先union,然后对整个结果集进行order by

select prod_name
from Products
union
select cust_name
from Customers
order by prod_name;

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务