题解 | #返回顾客名称和相关订单号#
返回顾客名称和相关订单号
http://www.nowcoder.com/practice/7e7bc361db6a4cb6aa35eefccfe75364
Solution 1:
SELECT a.cust_name,b.order_num FROM Customers a,Orders b WHERE a.cust_id=b.cust_id ORDER BY a.cust_name;
Solution 2:
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;