mysql查询需要多次使用聚合函数值
selectusernamefromtableAgroupbyusernamehavingcount(*)>(selectmaxfromtableBwheretableB...
select username from tableA
group by username
having count(*)>(select max from tableB where tableB.username=tableA.uername)
order by time
limit [这里就是想用count(*)减去(select max from tableB where tableB.username=tableA.uername)的值]; 展开
group by username
having count(*)>(select max from tableB where tableB.username=tableA.uername)
order by time
limit [这里就是想用count(*)减去(select max from tableB where tableB.username=tableA.uername)的值]; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询