- 当Update语句中的From表与Join表相同
* SQL
Sever : update t1
set
faccountid2=t2.faccountid from t_voucherentry t1 inner join
t_voucherentry t2 on t1.fvoucherid=t2.fvoucherid
where
t1.fdc=1 and t2.fdc=0 and
t1.fvoucherid= 0;
*
Sqlite
: update t_voucherentry set
faccountid2=t2.faccountid from t_voucherentry t1 inner join
t_voucherentry t2 on t1.fvoucherid=t2.fvoucherid where
t_voucherentry.fdc=1 and t2.fdc=0 and t_voucherentry.fvoucherid=
5;
Remark:SQL Server
from表用了别名后,语句中用到这个表的地方都必须用“别名”,类似update后面和Where后面;
Sqlite
from表用了别名后,语句中用到这个表的地方都必须用“实名”,类似update后面和Where后面;
加载中,请稍候......