Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to: SQL update statement
Message
 
À
19/09/2002 10:58:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00702283
Message ID:
00702369
Vues:
16
This works in SQL Server, but I don't know if VFP supports FROM as part of a UPDATE statement:
update products
	set unitsinstock=unitsinstock+1
	from products 
		inner join categories on products.categoryid = categories.categoryid
	where categories.categoryname = 'Beverages'
>Hi all,
>
>any one know how to do something like this:
>
>
>UPDATE table1 set mycolumn = table2.mymatchedcolumn ;
>WHERE (table1.keyid == table2.keyid )
>
>
>Where keyid is a foreign key into table2 from table1. I am using INDEXSEEK(), with lMovePointer turned on, to do similar things now, but it makes me slightly uncomfortable. :)
>
>
>UPDATE table1 set mycolumn = table2.mymatchedcolumn;
>WHERE INDEXSEEK(table1.keyid,.T.,"table2")
>
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform