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)

原文地址:https://www.cnblogs.com/hqbird/p/1652546.html