select a.*
from Tablename a
where
(
select count(*)
from Tablename as b
where a.group = b.group and a.id >= b.id
) <= 2
select a.*
from Tablename a
where
(
select count(*)
from Tablename as b
where a.group = b.group and a.id >= b.id
) <= 2