问下,有两张表,偶想有A中的一个字段是用A的一字段减去B中的一字段得到,为什么这样写不行呢?
update text2 a,text1 b set a.w=a.q-b.sd
数据格式都是varchar,请帮偶看看,谢谢
---------------------------------------------------------------
update text2 set text2.w=text2.q-test1.sd where text1.id=text2.id
---------------------------------------------------------------
update text2 from text1 set text2.w=text2.q-test1.sd where text1.id=text2.id
---------------------------------------------------------------
update table1 set
a = (select table1.c-b.d from table2 b where table1.id=b.id)
---------------------------------------------------------------
update text2 set text2.w=text2.q-test1.sd from text1 where text1.id=text2.id