sql - Update or Insert value if a field is NULL -


i know simple question wanted sure. have null value in field, , want change null value. change null value use insert or update?

for example: insert datatable (column 1) values (1) 'column 1' = null 

or

update datatable  set 'column 1' = 1 'column 1' = null 

thank you.

you use update updates , insert inserts(new records). update incorrect since cannot compare null values = or <>. therefore have use is:

update datatable  set [column 1] = 1 [column 1] null 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -