Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete SQL Command with Group By.
Message
From
04/08/2000 06:51:08
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
04/08/2000 05:11:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00400905
Message ID:
00400913
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform