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/archive/2010/01/20/1652546.html
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/archive/2010/01/20/1652546.html