Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete SQL Command with Group By.
Message
De
04/08/2000 06:51:08
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
04/08/2000 05:11:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00400905
Message ID:
00400913
Vues:
17
>Hello!
>
>I noticed the DELETE SQL command does not work with group by's like most SQL does.
>I am trying to do:
>
>DELETE FROM GROUPFLDS GROUP BY FNAME,GROUPNO HAVING COUNT(*) > 1 ;
>
>Like I would on Oracle but it does not work.
>
>What I am doing is trying to delete all duplicates on these two columns.

Hi,

Use a subquery here:
DELETE FROM MainFile WHERE FName IN
( SELECT FName, COUNT(*) FROM MainFile GROUP BY Fname HAVING COUNT(*) > 1)
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform