where shop_price>300 and shop_price<500where shop_price<300 or shop_price>500
where shop_price between 300 and 500
where shop_price >= 300 and shop_price <= 500
where cat_id in(4,5,6)cat_id=4 cat_id=5 cat_id=6
group by 需要配合一下5个聚合函数使用:
select cat_id.max(shop_price) from goods group by cat_id;
having必须作用于where之后
select cat_id,sum(shop_price*goods_number) as huokuan from goods group by cat_id having huokuan>20000;
limit[偏移量],条数
偏移量默认为0
Copyright © 2019- hz9.com.cn 版权所有
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务