update user_hcdetail a, user_hcdetail b, cpcshtins c, cpcwf d, cpcwfproc_v e set a.pno='200610100001' 楼主的from 是多余
sten(近视进士)的意思是这样?update user_hcdetail a, user_hcdetail b, cpcshtins c, cpcwf d, cpcwfproc_v e set a.pno='200610100001' Where b.shtinsid = c.shtinsid and c.wfid=d.wfid and d.wfid=e.wfid and d.currprocid=e.procid and e.procid=6 and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL)还是报错哦,说没有SET。 SORRY,偶是菜鸟
update user_hcdetail a set a.pno='200610100001' where exists(select 1 from user_hcdetail b, cpcshtins c, cpcwf d, cpcwfproc_v e Where b.shtinsid = c.shtinsid and c.wfid=d.wfid and d.wfid=e.wfid and d.currprocid=e.procid and e.procid=6 and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL)) 试试这个
To近视进士 语句检查通过了,但结果不对哦 单独执行: select 1 from user_hcdetail b, cpcshtins c, cpcwf d, cpcwfproc_v e Where b.shtinsid = c.shtinsid and c.wfid=d.wfid and d.wfid=e.wfid and d.currprocid=e.procid and e.procid=6 and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL) 的记录数有131条,是对的, 但UPDATE: update user_hcdetail a set a.pno='200610100001' where exists(select 1 from user_hcdetail b, cpcshtins c, cpcwf d, cpcwfproc_v e Where b.shtinsid = c.shtinsid and c.wfid=d.wfid and d.wfid=e.wfid and d.currprocid=e.procid and e.procid=6 and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL)) 确更新了2000多条记录,把length(rtrim(ltrim(b.pno)))>1 的记录都更新了 :(
update user_hcdetail b set b.pno='200610100001' where exists(select 1 from cpcshtins c, cpcwf d, cpcwfproc_v e Where b.shtinsid = c.shtinsid and c.wfid=d.wfid and d.wfid=e.wfid and d.currprocid=e.procid and e.procid=6 and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL))try this!
user_hcdetail b,
cpcshtins c,
cpcwf d,
cpcwfproc_v e
set a.pno='200610100001' 楼主的from 是多余
user_hcdetail b,
cpcshtins c,
cpcwf d,
cpcwfproc_v e
set a.pno='200610100001'
Where
b.shtinsid = c.shtinsid
and c.wfid=d.wfid
and d.wfid=e.wfid
and d.currprocid=e.procid
and e.procid=6
and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL)还是报错哦,说没有SET。
SORRY,偶是菜鸟
where exists(select 1 from user_hcdetail b,
cpcshtins c,
cpcwf d,
cpcwfproc_v e
Where
b.shtinsid = c.shtinsid
and c.wfid=d.wfid
and d.wfid=e.wfid
and d.currprocid=e.procid
and e.procid=6
and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL))
试试这个
单独执行:
select 1 from user_hcdetail b,
cpcshtins c,
cpcwf d,
cpcwfproc_v e
Where
b.shtinsid = c.shtinsid
and c.wfid=d.wfid
and d.wfid=e.wfid
and d.currprocid=e.procid
and e.procid=6
and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL)
的记录数有131条,是对的,
但UPDATE:
update user_hcdetail a set a.pno='200610100001'
where exists(select 1 from user_hcdetail b,
cpcshtins c,
cpcwf d,
cpcwfproc_v e
Where
b.shtinsid = c.shtinsid
and c.wfid=d.wfid
and d.wfid=e.wfid
and d.currprocid=e.procid
and e.procid=6
and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL))
确更新了2000多条记录,把length(rtrim(ltrim(b.pno)))>1 的记录都更新了 :(
where exists(select 1 from
cpcshtins c,
cpcwf d,
cpcwfproc_v e
Where
b.shtinsid = c.shtinsid
and c.wfid=d.wfid
and d.wfid=e.wfid
and d.currprocid=e.procid
and e.procid=6
and (length(rtrim(ltrim(b.pno)))<1 or b.pno is NULL))try this!