我的更新语句如下
update tab1
set hdzk = 0
where (cllx like 'G%' or cllx like 'B%' or cllx like 'H%' or cllx like 'Q%')
and (hdzk is not null or hdzk <> 0);
commit;
提示更新成功结果我用下面的语句查还是还有
select count(*)
from tab1
where (cllx like 'G%' or cllx like 'B%' or cllx like 'H%' or cllx like 'Q%')
and (hdzk is not null or hdzk <> 0);
update tab1
set hdzk = 0
where (cllx like 'G%' or cllx like 'B%' or cllx like 'H%' or cllx like 'Q%')
and (hdzk is not null or hdzk <> 0);
commit;
提示更新成功结果我用下面的语句查还是还有
select count(*)
from tab1
where (cllx like 'G%' or cllx like 'B%' or cllx like 'H%' or cllx like 'Q%')
and (hdzk is not null or hdzk <> 0);
你要知道hdzk is not null or hdzk <> 0 包括了hdzk=0的集合
??
是不是 hdzk is not null and hdzk <> 0
hdzk is not null or hdzk <> 0 这一句不包括了hdzk=0的集合
^_^>update test set id=0 where id=3;已更新 1 行。^_^>select id from test; ID
----------
1
1
2
2
1
0已选择6行。^_^>select id from test where id is not null or id<>0; ID
----------
1
1
2
2
1
0已选择6行。
也包含了hdzk = 0 的项目
楼主仔细考虑考虑