Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete all records in a group
Message
De
15/06/2006 20:34:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Delete all records in a group
Divers
Thread ID:
01129421
Message ID:
01129421
Vues:
69
Hi all,

I have a mytable with 3 fields:

team amount option

AAAA 1000 NO
AAAA 2000 YES
AAAA 3000 NO
AAAA 4000 NO

BBBB 1000 NO
BBBB -2000 YES
BBBB 3000 NO
BBBB 4000 NO

CCCC 1000 NO

DDDD 2000 NO

EEEE 8000 NO
EEEE -700 YES

in order to have a mynewtable

team amount option

AAAA 1000 NO
AAAA 2000 YES
AAAA 3000 NO
AAAA 4000 NO

CCCC 1000 NO

DDDD 2000 NO

the condition to delete all records in a group is when amount is negative AND
option = YES .

I try this but not work:, please assist to correct my SQL statment
delete * from mytable where ( mytable.amount < 0 and option mytable.option = YES ) 
in plain word when the amount is negative, delete that record or delete all records within the same group.

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform