Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HAVING clause check?
Message
From
08/05/2008 22:56:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01315930
Message ID:
01316009
Views:
22
Good to hear we're BOTH correct :-). Sergey, you are one of the most hands-on MVPs VFP has ever had. Good work.

>Yes, I'm sure and you're correct too. :)
>In a regular query HAVING is applied after GROUP BY and before ORDER BY. In UNION query HAVING can only be applied to individual SELECTS not the final recordset. Only ORDER BY is applied to the final recordset.
>
>but in UNION query it's aplied to individual record sets not the final recordset produced by the query.
>
>>Are you sure about that, Sergey? I thought that HAVING was applied after almost all other criteria in the SELECT clause; that is, applied to the preliminary result set and that was the difference between HAVING and WHERE.
>>
>>>No, only ORDER BY clause is applied to the whole result set. The HAVING clause is applied to each query in UNION. You can use derived table to apply additional conditions
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform