2019-02-25
阅读量:
734
sql高效查询的问题
问题描述:
表中有xx_id、time和type两个字段

查询xx_id相同并对应type为0,1 time时间相差10分钟内的个数,怎么组织sql最高效?
解决方法:
$time = time() - 600;
select xx_id,count(xx_id) count from tablename where type = 1 and time > $time group by xx_id;






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
1条评论