使用update语句,更新一个字段:update tableName set id=id+1;
但是如果id这个字段为null,那么update的字段仍然为null;
这时就需要先判断这个字段是否为null,使用isnull函数:update tableName set id=isnull(id,0)+1
使用update语句,更新一个字段:update tableName set id=id+1;
但是如果id这个字段为null,那么update的字段仍然为null;
这时就需要先判断这个字段是否为null,使用isnull函数:update tableName set id=isnull(id,0)+1