Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法通过 SQL 语句来确保列的默认值为空字符串''而不是NULL?
''
NULL
是 - 使用 DEFAULT 约束:
DROP TABLE IF EXISTS `example`.`test`; CREATE TABLE `example`.`test` ( `string_test` varchar(45) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1;