select * from Department a where a.personId in ( select * from ( select min(personId) as personId from Department b group by b.departId )) and mod(personId, 1000) !=1
判断字段是否连续
1 2 3 4 5 6 7
select * from ( select b.personId, ( select max(personId) from Department a where a.personId < b.personId and a.departId = b.departId ) as prePersonId from Department b ) where personId - 1 > prePersonId