题解 | #返回顾客名称和相关订单号#
返回顾客名称和相关订单号
https://www.nowcoder.com/practice/7e7bc361db6a4cb6aa35eefccfe75364
SELECT a.cust_name, b.order_num FROM Customers a INNER JOIN Orders b ON a.cust_id = b.cust_id ORDER BY a.cust_name, b.order_num
思路:
1.查询顾客名称,来源于表a
2.查询订单号,来源于表b
3.根据用户id联结表