Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select records, if repeat three time
Message
From
18/10/2008 05:58:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01355704
Message ID:
01355711
Views:
16
>Hi all, I want to select the records If result"Fail" is repeated 3 time .
>thanks
>SELECT * FROM examtran WHERE code="001724" AND year=2008 AND result="Fail" GROUP BY nmonth,result

Your question is not clear, Fail 3 times per Code? Or Fail 3 times per code, year? Anyway assuming per Code.
SELECT * FROM examtran WHERE code in ;
 (SELECT code FROM examtran where result=="Fail" having count(*) >= 3  GROUP BY code)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform