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--