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 17:12:56
 
 
À
31/03/2000 15:01:12
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:
00353672
Vues:
18
>I have a table with three fields, including one logical. I want to change the logical to .T. for every record that contains a unique entry. I've tried REPLACE MyTABLE.FIELD3 WITH .T. FOR (SELECT DISTINCT FIELD2 FROM MyTABLE) but I get a "Function name is missing )." What am I doing wrong?

Hi Peter,

Here is a simple solution:

UPDATE MyTable SET Field3 = .T. WHERE NOT Field2 IN (SELECT Field2 FROM MyTable WHERE Field3)

Best regards.

Alex
Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform