题解 |sql中outer join的使用
返回产品名称和与之相关的订单号
https://www.nowcoder.com/practice/c369a759436a4e8b80baa9c39e9adf18
( SELECT prod_name, order_num FROM Products LEFT JOIN OrderItems ON Products.prod_id = OrderItems.prod_id ) UNION ( SELECT prod_name, order_num FROM Products RIGHT JOIN OrderItems ON Products.prod_id = OrderItems.prod_id ) ORDER BY prod_name