Reputation:
How can I do something like that
SELECT * WHERE owner = '81',
owner = NULL
FROM outcome
or
UPDATE outcome SET NULL WHERE owner = '81'
So before request the table contains values 81
but after request corresponding values in NULL.
Upvotes: 2
Views: 57
Reputation: 1904
Is this what you want?
SELECT * FROM OUTCOME WHERE (OWNER IS NULL OR OWNER='81')
UPDATE outcome SET owner=NULL
WHERE owner = '81'
Upvotes: 1
Reputation: 39457
Assuming outcome is your table name, here is what you need:
UPDATE outcome
SET owner = NULL
WHERE owner = '81'
If you also want to select the updated rows see here:
So... in MySQL that part seems a bit tricky.
Upvotes: 1