Delete the problem of repeated record

xiaoxiao2021-03-06  105

From http://blog.itpub.net/post/330/3981 This problem is very simple, but it is often asked. It may be very slow, and the new method can be adopted after the 816 is available.

Useraccount table, primary key for userid, there is a field for mobile phone number Mobilephone If the proportion of repetitive records is not a big delete useeraccount where rowid in (SELECT ROWID RID, ROW_NUMBER () over (Partition By MobilePhone Order by Userid Desc) RN from useraccount) Where rn> 1);

I often use this way to delete data, and millions of records delete tens of thousands of speeds are still faster. Of course, if it is repeated, still simply do the TEMP table :)

转载请注明原文地址:https://www.9cbs.com/read-98803.html

New Post(0)