Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this Having clause?
Message
 
 
To
26/10/2005 18:16:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01062374
Message ID:
01062470
Views:
15
>
>The MAX() consumes &lcExpr and then the first field name into cCursor
>become "Max_MyField" and the HAVING fire a error.
>
>If this is not a problem, then you can rewrite this :
>
>select MAX(&lcExpr) as field1, ;
>   upper(&lcExpr) ;
>   from (tcAlias) ;
>   where not deleted() ;
>   &lcFilter ;
>   group by 2 ;
>   having not empty(field1) ;
>   into cursor (.cCursor)
>
>
>But remember, this is 99% match to the original, but not 100% equal .
>
>
>CREATE CURSOR BYBY (AA C)
>INSERT INTO BYBY VALUES ('a')
>INSERT INTO BYBY VALUES ('A')
>
>SET ENGINEBEHAVIOR 70
>SELECT AA,UPPER(AA) FROM BYBY GROUP BY 2
>
>SET ENGINEBEHAVIOR 90
>SELECT MAX(AA),UPPER(AA) FROM BYBY GROUP BY 2
>
>
>If you want 100% equal, use SET ENGINEBEHAVIOR 70 with the original select.

Thank you for the explanation and for the suggestion with SET ENGINBEHAVIOR 70. I appreciate your help very much!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform