简单查询
分組查詢查詢汽車(chē)表中,每個(gè)系列汽車(chē)的數(shù)量select brand,count(*) from car group by brand去該系列價(jià)格平均值大于40的系列代號(hào) select brand from car group by brand having avg(price)>40取該系列油耗最大值大于8的系列代號(hào)select brand from car group by having max(oil)>8去重查詢 select distinct brand from car分頁(yè)查詢select*from car limit 0,10聚合函數(shù) select cout(*) from car 有多少條信息 select avg(code) from car 平均值 select max(price) from car 最大值 select min(price) from car 最小值 select sum(price) from car 總格價(jià)格離散查詢select *from car where price=30 or price=40 or price=50 or price=60select * from car where price not in(30,40,50,60)范圍查找 關(guān)鍵字 between 之間的select *from car where price between 40 and 60
?
轉(zhuǎn)載于:https://www.cnblogs.com/benpaodegegen/p/5970240.html
總結(jié)
- 上一篇: 听说凤凰单丛都很贵?
- 下一篇: 电影《天下无贼》的内容是?