MySQL多表关联查询数量

it2024-12-09  18

//多表关联查询数量select user, t1.count1, t2.count2from user tleft join ( select user_id, count(sport_type) as count1 from sport group by user_id) t1on t.id = t1.user_idleft join ( select user_id, count(level) as count2 from grade group by user_id) t2on t.id = t2.user_idorder by t.id

转载于:https://www.cnblogs.com/liruning/p/6526539.html

相关资源:数据结构—成绩单生成器
最新回复(0)