1. 程式人生 > >MySQL,Oracle中空字符串和NULL

MySQL,Oracle中空字符串和NULL

oracl 字符串 空字符 sql name pda 不起作用 作用 upd

Mysql 中空字符串和NULL是不一樣的。

Oracle中空字符串就是NULL。

update User set realname =‘‘ where name = "ff"; -- 在Oracle中不起作用,只有NULL,沒有空字符串。

update User set mobile = null where name = "ff"; --在Mysql中設置mobile為空。

update User set mobile = "" where name = "ff"; --在Mysql中設置mobile為空字符串。

MySQL,Oracle中空字符串和NULL