>hi all
>i have two tables
>table1->id1,price1
>table2->id2,price2
>i want update table1(price1) by table2(price2) if id1=id2 by sql and not by view or programing with do while ..........and ....
>my tables are in visual foxpro and not in lower version
>how do it?
There's no update by subselect in VFP, but you can:
USE Table2 IN 0 TAG ID2
SELECT 0
USE Table1
SET RELATION TO ID1 INTO TABLE2
GO TOP
REPLACE price1 WITH Table2.price2 FOR FOUND('Table2')
SET RELATION TO
USE IN Table2