Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching for matching records with different event code
Message
From
02/04/2002 15:08:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00640052
Message ID:
00640063
Views:
18
>Okay I need to extract records in a table based on it occuring in the table more than 4 times, each time having a different event code.
>
>For example John Smith occurs 5 times with a different event code each time.
>Name Code
>John Smith emd1
>John Smith emd2
>John Smith emd3
>John Smith emd4
>John Smith emd5

Something like this:
select Name, count(*) as _Count from MyTable;
  group by Name;
  where _Count > 4;
  into cursor Temp1
select * from MyTable;
  where Name in (select Name from Temp1);
  into cursor Temp2
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform