firemail

标题: Mysql数据分组GROUP BY 和HAVING,与WHERE组合使用 [打印本页]

作者: java    时间: 2018-4-27 17:26
标题: Mysql数据分组GROUP BY 和HAVING,与WHERE组合使用
SELECT order_num,SUM(quantity*item_price) AS ordertotal FROM orderitems GROUP BY order_num HAVING SUM(quantity*item_price)>=50 ORDER BY ordertotal;  


[size=13.3333px]https://blog.csdn.net/liuchunming033/article/details/47279003





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3