燕尘的博客需求查询某个字段的时候需要给一个字段同样的值。这个值你可以写死,也可以从数据库获取1、写死值SELECTmfr_id AS mfrId,mfr_name AS mfrName,IFNULL(NULL, 587694978080178176) AS suppIdFROMmater_prod materProd...
刘弘扬的博客查询两张表 并且对为空的值做默认值 select u.User_pictureUrl,u.User_phone,u.ID as userId,u.user_nickname,IFNULL(f.userFriend_status,3)as status ,IFNULL(f.userFriend_comment,' ')as userFriend_comment,...
例如,我们可以为`birth2`字段设置默认值为'2013-01-01': ```sql alter table test add column birth2 date default '2013-01-01'; ``` 这将会确保`birth2`字段在没有指定值的情况下,自动填充为'2013-01-01'。 ...