标签:cli style where fonts 算数 ase rom 求和 img
product_name VARCHAR数据类型不支持 聚合函数SUM 求和算数运算;
SELECT子句 后面只能存在 GROUP BY子句中指定的列名(也就是聚合键);
子句的书写顺序 ,1. SELECT → 2. FROM → 3. WHERE → 4. GROUP BY
SELECT product_type, SUM(sale_price), SUM(purchase_price) FROM Product GROUP BY product_type HAVING SUM(sale_price) > SUM(purchase_price) * 1.5;
SELECT * FROM Product ORDER BY regist_date DESC, sale_price;
标签:cli style where fonts 算数 ase rom 求和 img
原文地址:https://www.cnblogs.com/MarlonKang/p/12228117.html