Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this SELECT SQL?
Message
 
 
À
29/03/2006 10:57:26
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01108740
Message ID:
01109027
Vues:
23
Good point. Just small correction. It was possible to write queries this (wrong) way before Set EngineBehavior was invented.

>Just to add, Ulises did not include every non-aggregate field (left out Productos.descrip) in the Group By clause that was in the Select clause. Although Set EngineBehavior allows you to write SQL this way it's bad practice and the values in the Productos.descrip column are essentially meaningless.
>
>
>>You cannot use aggregate function in the WHERE because they are not calculated yet. You should move it to HAVING clause
>>
>>>
SELECT Invent.codigo, Productos.descrip, SUM(Invent.saldoenivel);
>>> .....
>>> GROUP BY Invent.codigo;
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform