Something like this would work, you may also be able to make use of the SELECT DISTINCT
predicate if it helps - however, I think using the GROUP BY clause is cleaner and likely more efficient.
food for thought anyway...
select * from mytable where id=(
select id from mytable where sid=(
select Min(sid) from mytable
) limit 0,1
) or id=(
select id from mytable where sid=(
select Min(sid) from mytable where not sid=(
Select Min(sid) from mytable
)
)limit 0,1
);