
大家谁知道 sqlserver里 字段值为 null 在sql 语句里 怎么表示啊
比如:sql="updateSMT_ypsetSMT_type=0whereSMT_type=null"conn.execute(sql)我测试了,就是不管用!郁闷!在线...
比如: sql=" update SMT_yp set SMT_type=0 where SMT_type=null"
conn.execute (sql)
我测试了,就是不管用!郁闷!在线等! 展开
conn.execute (sql)
我测试了,就是不管用!郁闷!在线等! 展开
6个回答
展开全部
等于NULL 写为 where SMT_type is null
不为NULL 写为 where SMT_type is not null
等于空时才用=号 where SMT_type = ''
不为NULL 写为 where SMT_type is not null
等于空时才用=号 where SMT_type = ''
展开全部
sql=" update SMT_yp set SMT_type=0 where SMT_type is null"
回答者:cyrix123 - 举人 四级
回答者:cyrix123 - 举人 四级
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你直接把默认值改成0,不就可以了?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql=" update SMT_yp set SMT_type=0 where SMT_type is null"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql=" update SMT_yp set SMT_type=0 where isnull(SMT_type)=true "
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |