I have a table that has an auto incremented id PK, and, among others columns, a column that has a non-unique index on it, but there is data in it I know IS unique, named column4.
Is it possible to do an
(INSERT if column4="this_data") or (UPDATE if column4!="this_data")
?
Or am I best just to use two queries - a SELECT to get the PK id of the row where column4="this_data", and then either an INSERT or UPDATE once I know whether the row exists?
Thanks for your time and help.