问题:查询总订单价格大于100的订单号和总订单价格,SQL语句如下:
答案:SELECT o_num, SUM(quantity *item_price) AS orderTotal
FROM orderitems
GROUP BY o_num
HAVING SUM(quantity*item_price) >= 100;
问题:查询总订单价格大于100的订单号和总订单价格,SQL语句如下:
答案:SELECT o_num, SUM(quantity *item_price) AS orderTotal
FROM orderitems
GROUP BY o_num
HAVING SUM(quantity*item_price) >= 100;