sql语句:如何筛选重复数据

select
    t.schoolid,t.id,t.photoname
from
    T_SchoolPhoto t
where
    not exists(select 1 from T_SchoolPhoto where id>t.id and schoolid=t.schoolid)

posted @ 2010-01-20 16:59  Jason.Bird  阅读(5634)  评论(0编辑  收藏  举报