Good day,

I'm attempting to fix some bad data:

There is a table products where has a location id.  Unfortunately
duplicate dictionary names got added to list of locations

products has    locationid and a bunch of other stuff

I can easily get the max (bad) and min  (good)  location ids
associated with each name  (I know I should have made the name field
UNIQUE... mistakes were made years ago)

how do I write an update that essentially says

update products set locationid = good where locationid = bad  , but do
it for each good & bad pair ?

I can see how to do it with insert or replace, but is there a way to
do it with UPDATE?

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

Reply via email to