SELECT y.name, x.val FROM (SELECT b.subject_id AS id, COUNT(a.`id`) AS val FROM Student_Info AS a LEFT JOIN Subject_Register AS b ON a.id = b.student_id WHERE a.`gender` = 2 GROUP BY b.subject_id) AS X LEFT JOIN Subject_Info AS Y ON y.id = x.id ORDER BY x.val DESC LIMIT 0, 3; 这个SQL为什么错了
点赞 3

相关推荐

找不到工作死了算了:没事的,雨英,hr肯主动告知结果已经超越大部分hr了
点赞 评论 收藏
分享
牛客网
牛客企业服务