0

I like to replace a 'NULL' value in FG_NFG_Selektion column but only in those row where Plant='935S'

current

Tried:

UPDATE [Table] SET [FG_NFG_Selektion] = REPLACE([FG_NFG_Selektion], 'NULL', 'FG') WHERE [Plant] = '935S'

Message back: 10000 rows affected but still the same 'NULL' is there in the table.

1
  • ‘Null’ is not the same as null and you don’t need replace Commented Feb 19, 2020 at 16:50

1 Answer 1

1

Try with following query

UPDATE [Table] SET `FG_NFG_Selektion` = 'FG' WHERE `Plant` = '935S' AND `FG_NFG_Selektion` IS NULL;
Sign up to request clarification or add additional context in comments.

2 Comments

IS NULL will use to check for the null values in SQL.
Also, do not forget to replace your actual table name with [Table]

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.