以下两行sql数据有什么区别呢?
alter table `test_table` add `filed3` int(10) unsigned not null default 0 after `field2`;
alter table `test_table` add `filed3` int(10) unsigned not null default '0' after `field2`;
查询test_table这个表的field3字段时,会发现这两种方式在效果上没有任何区别,它的值都是0,mysql应该会对field3这个字段的值进行处理,发现其实int类型的,故把'0'转为0。
参考资料:
https://www.cnblogs.com/bashaowei/p/8526987.html