Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid Group By issue (what fields to include)
Message
 
 
To
24/05/2006 16:02:41
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01124674
Message ID:
01124685
Views:
11
Use numbers in Group By

e.g.

select field1, field2, field3, sum(field4), field5, expr as field6
group by 1,2,3,5,6

>Using ENGINEBEHAVOIR 80, how do I include some of these fields in the GROUP BY clause?
>I know that SUM(whatever) does not need to be inlcuded, but what about character functions?
>Or the IIF conditional with more than one field referenced? Or the ' 0' AS retireage column?
>Do these need to be included?
>I'm getting INVALID GROUP BY on this (part of a much larger SQL) and can't figure out why.
>
>
>	new.midname,;
>	LEFT(new.lastname, 15) AS lastname,;
>	LEFT(new.employer,35) AS employer,;
>	LEFT(IIF(NVL(inservice.AcctType,1) = 1, pmplan.planname, inservice.bucketname),50) AS plan_name,;
>	STR(ROUND(new.er_perves,0),3) AS er_perves,;
>	STR(ROUND(new.oth_perves,0),3) AS oth_perves,;
>	new.plantype,;
>	new.webenable,;
>	new.invnum,;
>	STR(new.planid,10,0) AS planid,;
>	IIF(pmplan.doProjBen = .T. AND new.AcctType = 1, new.avg5yrcont, 000000000.00) AS avg5yrcont,; &&****************** Retirement Account OK, InServ, Edu 0
>	' 0' AS retireAge,;
>	old.pin,;
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform