关于mysql的问题 10
(selectcount(1)fromtour.sign_scores,tour.sign_loglwheres.uid=l.uidandscore>=(selectsc...
(select count(1) from tour.sign_score s,tour.sign_log l where s.uid=l.uid and score >=(select score from tour.sign_score where uid =?)
group by s.uid having max(create_time)>=(select max(create_time) from tour.sign_log where uid = ? group by uid ))reg_ranking,
我是想计算我的积分排名,分数相同的话就用最后签到的时间进行排名,我自己写了个,但是显示是错误的,
sign_score 用户积分表
uid score
sign_log 用户签到表
uid score_value create_time
对groupby 和having不是很熟 展开
group by s.uid having max(create_time)>=(select max(create_time) from tour.sign_log where uid = ? group by uid ))reg_ranking,
我是想计算我的积分排名,分数相同的话就用最后签到的时间进行排名,我自己写了个,但是显示是错误的,
sign_score 用户积分表
uid score
sign_log 用户签到表
uid score_value create_time
对groupby 和having不是很熟 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询