
比如:orderprogressno字段的值分别为1,2,3,4,那么就是查询值为1的总条数和值为2的总条数
select orderno,count(orderprogressno)from servicerepair
已阅读 = sum(case when orderprogressno =1 then 1 else 0 end),
未阅读 = sum(case when orderprogressno =2 then 1 else 0 end),
from servicerepair
select * from tableName where a=1 order by id desc limit 0,10 select * from tableName where a=1 order by addTime desc limit 0,10第一句是按id排序取最新10条 ,第二句是根据时间排序取最新的10条。(MYSQL)
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)