或 select a.* from mytable a join (select class,min(id) as id from mytable group by class) b on a.class = b.class
select aa.* from mytable aa,(select class,min(id) from mytable group by class ) bb where aa.id=bb.id
select * from mytable right outer join (select class,min(id) id from mytable group by class) min_table on mytable.class = min_table.class and mytable.id = min_table.id
select * from mytable a where id=(select top 1 id from mytable where class=a.class order by id desc)
select b.class,a.title,b.id,a.pic from mytable a, (select class,min(id) as id from mytable group by class)b where a.class=b.class and a.id=b.id order by b.id
select a.* from mytable a,( select title,id=min(id) --升序用min,降序用max from mytable group by title )b on a.title=b.title and a.id=b.id
select a.* from mytable a
join (select class,min(id) as id from mytable group by class) b
on a.class = b.class
from mytable aa,(select class,min(id) from mytable group by class ) bb
where aa.id=bb.id
(select class,min(id) as id from mytable group by class)b
where a.class=b.class and a.id=b.id
order by b.id
from mytable a,(
select title,id=min(id) --升序用min,降序用max
from mytable group by title
)b on a.title=b.title and a.id=b.id