101

I would like to update my column with other column in other table. Before doing so, I would like to nullify my column(integer) first. However, below code did not work. (column_a: bigint; column_b: text)

UPDATE table1
SET column_a IS NULL
WHERE column_b = 'XXX';

ERROR: syntax error at or near "ISNULL"

1
  • 5
    Got an answer. For integer column, this should be "= null" Commented Oct 18, 2017 at 4:43

1 Answer 1

176

This should be,

UPDATE table1 
SET column_a = NULL
WHERE column_b = 'XXX';
Sign up to request clarification or add additional context in comments.

1 Comment

can you somehow do that from the table view? Like with mySql Workbench you right click a field and there's a set to null option there. Never mind me you can just delete the value from a field and it will set it to null.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.