Maybe been asked a hundred times but Im seeking for an elegant way to get rid of duplicate rows which had been entered during development.
I have a database "versionen.sq3" having a table created by

CREATE TABLE version (major TEXT, minor TEST, date DATE)

Due to running across an iPython notebook several times it happened that I now have every row occuring as duplicate around five times or so.

Two questions:

   1.  would like to delete all duplicate rows by some SQL statement

2. defend myself against this happening again, that is, major,minor and date may only occur one time in ther respective combination.

I think I'll have to create some UNIQUE Key. Also, when INSERTing I would like to avoid error messages being thrown in case of a duplicate row coming along.

Thanks.

--
Christoph



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to