SELECt a.* FROM test a WHERe a.attendence = 1 AND NOT EXISTS (select 1 from test where name = a.name and id > a.id and attendence = 1)GROUP BY name
甚至可能不再需要该组。

SELECt a.* FROM test a WHERe a.attendence = 1 AND NOT EXISTS (select 1 from test where name = a.name and id > a.id and attendence = 1)GROUP BY name
甚至可能不再需要该组。