Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Having vs Where?
Message
De
08/05/1996 15:06:37
 
 
À
03/05/1996 17:17:35
Christian Berrigan
Enterprise Data Solutions, Inc.
Brush Prairie, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00001030
Message ID:
00001151
Vues:
46
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
Fil
Voir

Click here to load this message in the networking platform