Hello Christian: Thank you for your answer---better than the book answer!!
Thanks
Karl
>Gentlemen,
>
>Here's the basic scoop on HAVING.
>
>HAVING evaluates the result set, WHERE evaluates
>the source data.
>
>For example:
>
>SELECT myfield1, myfield2, COUNT(*) AS 'Count' ;
> FROM mytable ;
> WHERE myfield1 = 'AAA' ;
> GROUP BY myfield2 ;
> HAVING Count > 2
> INTO CURSOR TestHaving
>
>This selects all the records where myfield1 =
>'AAA' and groups them together by myfield2. The
>count field is the number of occurrences where
>myfield2 has the same value. The HAVING clause
>then only returns records in the result set where
>the count field was greater than 2.
>
>
>Hope this clarifies things.....
>
>
>
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement