How do I UPDATE a column in a MySQL-table if and only if a row with a corresponding column "id" exists?
Example of my table:
id | name
---------
1 | NULL
2 | NULL
Example of my data (CSV):
1, Peter
2, Martin
3, Bob
I want Peter and Martin in the table. But I want Bob to be ignored. My query I came up with looks like this:
"UPDATE table SET name = %s WHERE id = %s"
But what would happen while doing:
"UPDATE table SET name = 3 WHERE id = Bob"
?