????MYSQL ???????????????????????????????????????? MYSQL ??????????????????????????????????????????????????????????
????SQL???????????????????
????1. ??????ж????????????????????????????Σ?peopleId?????ж?
????select * from people
????where peopleId
????in (select peopleId from people
????group by peopleId
????having count(peopleId) > 1)
????2. ??????ж????????????????????????????Σ?peopleId?????ж??????? rowid С????
????delete from people
????where peopleId
????in (select peopleId from people
????group by peopleId
????having count(peopleId) > 1)
????and rowid not in (
????select min(rowid) from people
????group by peopleId
????having count(peopleId)>1)
????3. ??????ж?????????????????Σ?
????select * from vitae a
????where (a.peopleId??a.seq)
????in (select peopleId??seq from vitae
????group by peopleId??seq
????having count(*) > 1)
????4. ??????ж?????????????????Σ???????? rowid С????
????delete from vitae a
????where (a.peopleId??a.seq)
????in (select peopleId??seq from vitae
????group by peopleId??seq
????having count(*) > 1)
????and rowid not in (
????select min(rowid) from vitae
????group by peopleId??seq having count(*)>1)
????5. ??????ж?????????????????Σ????????? rowid С????
????select * from vitae a
????where (a.peopleId??a.seq)
????in (select peopleId??seq from vitae
????group by peopleId??seq
????having count(*) > 1)
????and rowid not in (
????select min(rowid) from vitae
????group by peopleId??seq
????having count(*)>1)
???????? SQL ???????????????????????????????????