SQL??????????????????
???????????? ???????[ 2016/11/28 13:21:41 ] ????????SQL Server ?????
????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 ???????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11