UPDATE TABLE1 SET 前电量=(SELECT 前电量 FROM TABLE2 WHERE TABLE2.序号=TABLE1.序号)WHERE 日期=今天的日期try
你试试这样写 UPDATE TABLE1 SET 现电量=b.前电量 from tabele1 a inner join table2 b on a.序号=b.序号 WHERE a.日期=今天的日期如果不支持inner join 试试UPDATE TABLE1 SET 现电量=b.前电量 from tabele1 a ,table2 b where a.序号=b.序号 and a.日期=今天的日期
我是问TABLE1里有没有日期=今天的日期的记录
update table1Name set 现电量=前电量 where ID=Table2Name.ID 就行。
TABLE1、TABLE2都有记录。
UPDATE TABLE1 SET 现电量=b.前电量
from tabele1 a inner join table2 b on a.序号=b.序号
WHERE a.日期=今天的日期如果不支持inner join
试试UPDATE TABLE1 SET 现电量=b.前电量
from tabele1 a ,table2 b
where a.序号=b.序号 and a.日期=今天的日期
我想<daifei>的回复应该能行;