89

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"

Community
  • 1
  • 1
no_name
  • 1,083
  • 1
  • 8
  • 12

1 Answers1

159

This should be,

UPDATE table1 
SET column_a = NULL
WHERE column_b = 'XXX';
Community
  • 1
  • 1
shiv
  • 1,940
  • 1
  • 15
  • 22
  • 1
    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. – Spyros_Spy Mar 22 '21 at 10:04