python sqlite3 DELETE FROM table row if exists -
i have python script inserts rows table. want either delete duplicate rows or ignore insert if row exists. have tried far:
#delete duplicate entries c.execute('''delete server sites not in (select min(sites) sites server group sites)''')
the table "server" single column "sites". table of web sites. it's not throwing errors. it's doesn't not deleting duplicates.
comparing against sites
not help, because duplicates have same value in column.
you have use other column unique. in case, use rowid:
delete server rowid not in (select min(rowid) server group sites);
Comments
Post a Comment