我想统计该生在该章节的 *做题总数* 中的排行
select count(1) from (select count(*) as con from test_log where chapter_id=12 group by user_id) as a where a.con>= (select count(*) from test_log where user_id=3 and chapter_id=12); select count(1)
select count(1) from (select count(*) as con from test_log where chapter_id=12 group by user_id) as a where a.con>= (select count(*) from test_log where user_id=3 and chapter_id=12); select count(1)