题解 | #返回顾客名称和相关订单号以及每个订单的总价#
返回顾客名称和相关订单号以及每个订单的总价
http://www.nowcoder.com/practice/4dda66e385c443d8a11570a70807d250
SELECT c.cust_name, oi.order_num, CONVERT((oi.item_price*oi.quantity),DECIMAL) AS OrderTotal
FROM Customers AS c INNER JOIN Orders AS o using(cust_id) INNER JOIN OrderItems AS oi using(order_num)
ORDER BY 1,2;