A query that works for all DB engines would be
select t1.*from sch.mytable t1join( SELECT min(id) as id FROM sch.mytable GROUP BY key) t2 on t1.id = t2.id
min(id) is the function that influences which result you get. If you use
max(id) you get the other.