背景:
设置了一个用户表 talent 列有学历ID、学历、姓名,请问我的学历ID是设置 int not null default 0 合适呢还是 int default null 合适呢?
答案:
default 0 合适;
1 查找不方便,比如我们想查找非本科学历(ID 值为5)的候选人,
select id,chnname,highdegree_id,highdegree_name from zp_talent where highdegree_id != 5 and id=460;
对于未填写学历的人比如 null 值我们无法获取,只能通过 is null 获取
原文:https://www.cnblogs.com/xuweiqiang/p/14687566.html