Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching for matching records with different event code
Message
De
02/04/2002 15:08:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00640052
Message ID:
00640063
Vues:
19
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform