I'm trying to populate a new SQLite database with rows based on a dataset, but I'm having trouble deleting duplicate rows. I could do this in Python, but in SQLite, there certainly should be a design option to handle.
I need each line to exist only for a unique combination of three text fields. If I make each text field bounded using UNIQUE, then all three must be unique. But instead, I would choose a unique combination of three lines.
In other words, these records should be able to exist: (a, a, a) (a, a, b) (a, b, b) (b, b, b)
If I do all three UNIQUE fields and insert these rows, only (a, a, a) and (b, b, b) are inserted. I could concatenate fields 1-3 in Python and use this as a primary key, but this seems like extra work.
Thomas
source share