Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using an sql statement as a condition in another action
Message
De
31/03/2000 18:20:58
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
 
 
À
31/03/2000 17:12:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00353571
Message ID:
00353707
Vues:
21
>UPDATE MyTable SET Field3 = .T. WHERE NOT Field2 IN (SELECT Field2 FROM MyTable WHERE Field3)

This works in theory only:

suppose that every record field3 = .F.
..the subquery will yield no results, and the update will set every field3=.T.

Considering that MyTable is likely to start with field3 being unassigned and the records being added with possible dupes on field2, it is likely this statement will be toggling the field3 values.

The update sql is a great way to do this job, but like an SQL-Select, it takes a bit of tweaking before you get the correct results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform