Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HAVING Clause in SQL
Message
De
03/07/2003 09:46:46
 
 
À
03/07/2003 09:32:15
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00806508
Message ID:
00806524
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
Renoir,

Yes, the HAVING clause is like a WHERE clause but for the intermediate record set (groups) created by GROUP BY. It's used when you want to apply conditions to the groups records. For example, find all duplicates in the table
SELECT keyfld, COUNT(*) AS DupCnt ;
  FROM mytable ;
  GROUP BY 1 ;
  HAVING DupCnt > 1
>Hey Sergey,
>
>How did I know it would be you to respond? <s>
>
>So, it almost like the SQL runs with the GROUP BY and then another WHERE is put on the results with the HAVING clause?
>
>What is the HAVING clause normally used for? To filter records after the SQL has processed?
>
>Renoir
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform