1、查询中的having。
案例:
select goods_id,goods_name,market_price - shop_price as discount from goods where 1 having discount>200;
2、having与group综合运用
Ecshop中(having与group by同时使用)
查询模型: select 列变量,结果列变量 as K from 表名 group by 表的列变量 having 判断语句。
案例:
select cat_id,sum(goods_number*shop_price) as K from goods group by cat_id having K>20000;
mysql中having与group的使用
最新推荐文章于 2023-06-07 15:47:32 发布