Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching for matching records with different event code
Message
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:
00640058
Vues:
15
I'm not sure if it can be done in one select.
* Get rid off duplicate events
Select Name, Code ;
  From mytable ;
  Group By Name, Code ;
  INTO CURSOR crsTemp1 NOFILTER
* Get  result
Select Name, COUNT(*) AS EventCount ;
  From crsTemp1 ;
  Group By Name ;
  HAVING EventCount > 4
  INTO CURSOR crsResult
>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform