风云榜查询名次 接单者与公司对应的数据库语句
程序员文章站
2022-03-30 16:40:30
...
1,用户:
SELECT user_name,COUNT(project_id) sumworkerpro,DATE_FORMAT(projectbidding.create_time,'%Y') datamonth
from user,projectbidding where user.id=projectbidding.user_id GROUP BY user_id ORDER BY COUNT(project_id) DESC LIMIT 3;
2,公司:
SELECT user_name,COUNT(project.id) sumboospro,DATE_FORMAT(project.create_time,'%Y') dateMonth
from user, project WHERE user.id=project.publisher GROUP BY user.id ORDER BY COUNT(project.id) DESC limit 3 ;
上一篇: 浮点数的误差