• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?


  • Subject: Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
  • From: Miguel Arroz <email@hidden>
  • Date: Sat, 11 Jun 2011 18:59:17 +0100

Hey,

  You're doing that in a very, VERY weird way. Why not using Wonder, as Pascal suggested? It will generate a proper query and no work for you.

  Regards,

Miguel Arroz

On 2011/06/11, at 12:18, Alexander Spohr wrote:

> Looks like the bug is mine. I did not read the statement as i should, as the count(*) is an attribute.
>
> To count an entity I add an Attribute "count(*)" on the fly to the entity.
> This attribute seems to be still in the entity while another fetch runs.
>
> This surprises me somewhat as I thought that my app is not multithreaded inside EOF.
> But maybe I get an uncatched exception that keeps the count attribute from being removed. I'll check into that.
>
> Sorry for the noise!
>
> 	atze
>
>
>
>
> Am 11.06.2011 um 12:25 schrieb Alexander Spohr:
>
>> That is done by EOF.
>>>> com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializationOfObject
>>
>> It bring my apps speed massively down.
>> We had no exceptions until today.
>>
>>
>> Am 11.06.2011 um 12:18 schrieb Pascal Robert:
>>
>>> Are you calling straight SQL or does that call was made with ERXControlUtilities aggregate methods? You can't do a count(*) and having all attributes listed after, that's why you are getting the "must appear in the GROUP BY clause" error.
>>>
>>>> Hi List,
>>>>
>>>> this is a strange one:
>>>> - allianceID is nullable.
>>>> Any idea what the problem here might be?
>>>>
>>>> 	atze
>>>>
>>>>
>>>> JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT count(*), t0.allianceID, t0.alliancePermission, t0.comment, t0.creationDate, t0.deletionDate, t0.gold, t0.id, t0.lastReadForumDate, t0.lastReadReportDate, t0.loginId, t0.nick, t0.points, t0.rank FROM Player t0 WHERE t0.allianceID = ?::int4" with
>>>> Bindings: 1:71(allianceID)>:
>>>> Next exception:SQL State:42803 -- error code: 0 -- msg: ERROR: column "t0.allianceid" must appear in the GROUP BY clause or be used in an aggregate function
>>>> Position: 18
>>>> at com.webobjects.jdbcadaptor.JDBCContext._jdbcErrorWithChannel(JDBCContext.java:170)
>>>>  ... skipped 7 stack elements
>>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
>>>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
>>>> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1206)
>>>>  ... skipped 1 stack elements
>>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlobalID(EOObjectStoreCoordinator.java:634)
>>>> at com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID(EOEditingContext.java:3923)
>>>> at er.extensions.eof.ERXEC.objectsForSourceGlobalID(ERXEC.java:1169)
>>>>  ... skipped 1 stack elements
>>>> at com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializationOfObject(EOAccessArrayFaultHandler.java:77)
>>>> at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead(_EOCheapCopyMutableArray.java:39)
>>>> at com.webobjects.eocontrol._EOCheapCopyMutableArray.count(_EOCheapCopyMutableArray.java:96)
>>>> at com.webobjects.foundation.NSArray.size(NSArray.java:1026)
>>>> at com.xyrality.bk.eo.Alliance.publicPropertyList(Alliance.java:84)
>>>> at com.xyrality.bk.eo.Player.publicPropertyList(Player.java:249)
>>>> at com.xyrality.bk.eo.Habitat.publicPropertyList(Habitat.java:1187)
>>>> at com.xyrality.bk.core.MapTile.propertyList(MapTile.java:54)
>>>>  ... skipped 10 stack elements
>>>> at com.xyrality.bk.actions.MapAction.map(MapAction.java:71)
>>>> at com.xyrality.bk.actions.MapAction.mapAction(MapAction.java:57)
>>>>  ... skipped 3 stack elements
>>>> at com.webobjects.appserver.WODirectAction.performActionNamed(WODirectAction.java:144)
>>>> at er.extensions.appserver.ERXDirectAction.performActionNamed(ERXDirectAction.java:401)
>>>> at com.xyrality.bk.actions.BKDirectAction.performActionNamed(BKDirectAction.java:84)
>>>>  ... skipped 6 stack elements
>>>> at com.xyrality.bk.Application.dispatchRequest(Application.java:63)
>>>> ... skipped 3 stack elements
>>>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
      • From: Alexander Spohr <email@hidden>
References: 
 >SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY? (From: Alexander Spohr <email@hidden>)
 >Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY? (From: Pascal Robert <email@hidden>)
 >Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY? (From: Alexander Spohr <email@hidden>)
 >Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY? (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
  • Next by Date: Re: JavaMonitor's Arguments
  • Previous by thread: Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
  • Next by thread: Re: SELECT count(*) throws - column "t0.allianceid" must appear in the GROUP BY?
  • Index(es):
    • Date
    • Thread