标签:des 使用 on c ef sql res mysql rom
需要使用join,例如
select g.id,g.res_count,count(gr.r_id) cnt from mb_game_res gr left join mb_game g on gr.g_id = g.id group by gr.g_id order by cnt desc
update mb_game a left join (select g.id id,count(gr.r_id) cnt from mb_game_res gr left join mb_game g on gr.g_id = g.id group by gr.g_id) b on a.id = b.id set a.res_count = b.cnt
标签:des 使用 on c ef sql res mysql rom
原文地址:http://www.cnblogs.com/kudosharry/p/3946666.html