我要实现的功能是这样的:
有两个表:table1 字段:s1,arf
table2 字段:ss,sums
现在希望对table1更新数据:
如果table1.s1=table2.ss
那么更新为:table1.arf=table1.arf/table2.sums
我是这样写的:
update table1
set table1.arf=table1.arf/table2.sums
where table1.s1 in (select ss from table2)
一运行就报错:说invalid fieldname:sums
什么问题阿
有两个表:table1 字段:s1,arf
table2 字段:ss,sums
现在希望对table1更新数据:
如果table1.s1=table2.ss
那么更新为:table1.arf=table1.arf/table2.sums
我是这样写的:
update table1
set table1.arf=table1.arf/table2.sums
where table1.s1 in (select ss from table2)
一运行就报错:说invalid fieldname:sums
什么问题阿
解决方案 »
- 恭喜月亮MM升级
- toolbar上的toolbutton按钮设置位置无效?
- 如何自动生成字段编号
- 怎么运行一个外部程序?
- 把dbnavigator控件中的按钮竖着排!
- 我要编一个英文打字软件(界面是中文),如果有特色,在中国国内会好买吗?
- CSDN没高手!!!!!!!!!!!!!!!!!!!!!!!!!!看这个问题
- 为什么不能用shellexecute呢?
- 请问inforpower3000中的wwDBGrid有统计功能吗?
- 本地连接网卡状态判断
- ShellExecute(0,'open',Pchar(URL_Name),Nil,Nil,SW_NORMAL);不能在dll中使用
- 怎么判断一个BAT文件的运行状态,大虾请进,急!!!!!!
set table1.arf=table1.arf/table2.sums
from table1,table2
where table1.s1 in (select ss from table2)注意 from
说:invalid use of keyword :from
update后面能跟from吗?
Update table1 set arf=arf/(select table2.sums from table2
where table1.s1=tble2.ss)
上一句可能在错,
说invalid fieldname:sums,说明 Table2中无此字段,请再仔细查一下吧!
下次问问题时记偏住给点分..............
where table1.s1=table2.ss
set arf=table1.arf/table2.sums
from table1,table2
where table1.s1=table2.ss