可是我这么写运行出来没有任何记录被修改.已经查出确实有相同的id.
语句这么写的:
UPDATE A SET A.Column1=B.Column2 WHERE A.id=B.id
后来网上查了一下,用了这个:
select B
scan
update A;
set Column1= B.Column2 ;
where id= B.id
endscan
可是执行出缺少endscan关键字。
到底这个语句该怎么写啊
3 个解决方案
#1
VFP9:
update A FROM B set Column1= B.Column2 where id= B.id
VFP6-8:
select B
DO WHILE !EOF()
update A;
set Column1= B.Column2 ;
where id= B.id
SELE B
SKIP
endDO
update A FROM B set Column1= B.Column2 where id= B.id
VFP6-8:
select B
DO WHILE !EOF()
update A;
set Column1= B.Column2 ;
where id= B.id
SELE B
SKIP
endDO
#2
vfp9.0:
UPDATE A SET A.Column1=B.Column2 from b WHERE A.id=B.id
vfp9.0以下(以下需要建一个PRG程序,然后运行PRG程序)
use B
scan
update A set Column1= B.Column2 where id= B.id
endscan
UPDATE A SET A.Column1=B.Column2 from b WHERE A.id=B.id
vfp9.0以下(以下需要建一个PRG程序,然后运行PRG程序)
use B
scan
update A set Column1= B.Column2 where id= B.id
endscan
#3
从t2更新t1
update t2 set t2.content=t1.content from t1 where t1.id=t2.id
update t2 set t2.content=t1.content from t1 where t1.id=t2.id
#1
VFP9:
update A FROM B set Column1= B.Column2 where id= B.id
VFP6-8:
select B
DO WHILE !EOF()
update A;
set Column1= B.Column2 ;
where id= B.id
SELE B
SKIP
endDO
update A FROM B set Column1= B.Column2 where id= B.id
VFP6-8:
select B
DO WHILE !EOF()
update A;
set Column1= B.Column2 ;
where id= B.id
SELE B
SKIP
endDO
#2
vfp9.0:
UPDATE A SET A.Column1=B.Column2 from b WHERE A.id=B.id
vfp9.0以下(以下需要建一个PRG程序,然后运行PRG程序)
use B
scan
update A set Column1= B.Column2 where id= B.id
endscan
UPDATE A SET A.Column1=B.Column2 from b WHERE A.id=B.id
vfp9.0以下(以下需要建一个PRG程序,然后运行PRG程序)
use B
scan
update A set Column1= B.Column2 where id= B.id
endscan
#3
从t2更新t1
update t2 set t2.content=t1.content from t1 where t1.id=t2.id
update t2 set t2.content=t1.content from t1 where t1.id=t2.id