Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this SELECT SQL?
Message
 
 
To
29/03/2006 10:57:26
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01108740
Message ID:
01109027
Views:
24
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform