如果bianhao不重复:update zl
set xuhao=(select count(*) from zl b where b.bianhao<=a.bianhao)
from zl a如果bianhao重复,就要用临时表来倒一下,才能保证正确。
set xuhao=(select count(*) from zl b where b.bianhao<=a.bianhao)
from zl a如果bianhao重复,就要用临时表来倒一下,才能保证正确。
另外,如果还有一个字段gongzi,有重复,但是
bianhao不重复,要求按gongzi,bianhao排序,还是
更新xuhao的值为1,2,3,4,......怎么来写呢?嘻嘻,我是不是得寸进尺?:)