Re: ERROR: syntax error at or near "group"

From: Suresh Borse <s(dot)borse(at)direction(dot)biz>
To: Premila Devi <premiladevi(dot)dayalan(at)agbnielsen(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, renato(dot)oliveira(at)grant(dot)co(dot)uk
Subject: Re: ERROR: syntax error at or near "group"
Date: 2009-12-28 09:44:48
Message-ID: 1261993488.2301.22.camel@dss-052.dsslp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

what is "alq.assetStatus " and " alq.asset"? Is it a table name?

syntax for referring column is "tablename.columnname" .

We need to use column names in the group by clause.

I think you need to check query syntax and you have not used assetStatus
table in the query.

On Mon, 2009-12-28 at 16:40 +0800, Premila Devi wrote:
> select sum(alq.quantity + alq.locked), category.id,
> alq.assetStatus.name
>
> from AssetLocationQuantity alq inner join alq.asset asset inner join
> asset.assetModel model inner join model.category category
>
> group by category, alq.assetStatus.name;
>
>
>
> Error :
>
>
>
> ERROR: syntax error at or near "group"
>
> LINE 3: group by category, alq.assetStatus.name;
>
> ^
>
>
>
> ********** Error **********
>
>
>
> ERROR: syntax error at or near "group"
>
> SQL state: 42601
>
> Character: 201
>
>
>
>
>
> http://cs.agbnmr.com/ci/autocomposition/logo_agb.jpg
>
> Warmest Regards,
>
> Premila Devi Dayalan Ramasamy
> Programmer Analyst
> MSAP Production Development
>
> AGB Nielsen Media Research
> Level 7,Block B,Menara PKNS-PJ,Jalan Yong Shook Lin , 46050 Petaling
> Jaya , Selangor
> ( Malaysia )
>
> t: 603-7620 2320
> f: 603-7620 2316
>
> Please note:
> This email transmission including its attachments, are intended only
> for the person or entity to which it is addressed and may contain
> confidential and/or privileged material. Any views or opinions are
> solely those of the author and do not necessarily represent those of
> AGB Nielsen Media Research, unless specifically stated. Any review,
> retransmission, dissemination or other use of, or taking of any action
> in reliance upon, this information by persons or entities other than
> the intended recipient is prohibited. If you received this email in
> error, please contact the sender and delete the email transmission
> immediately.
>
>

Thanks & Regards,

Suresh Borse
(DBA)
_________________________________________________________________________________________
DIRECTION SOFTWARE SOLUTIONS
5, Brady Gladys Plaza, 1/447, Senapati Bapat Marg, Lower Parel, Mumbai -
400 013
Tel. : 91 22 66615000 (Ext: 270) Fax : 91 22
24911046
Cell :
Site : www.direction.biz
_________________________________________________________________________________________

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Shruthi A 2009-12-28 11:34:25 Re: ERROR: syntax error at or near "group"
Previous Message Premila Devi 2009-12-28 08:40:20 ERROR: syntax error at or near "group"