Home » SQL & PL/SQL » SQL & PL/SQL » GROUP BY is showing error
GROUP BY is showing error [message #248065] Wed, 27 June 2007 23:33 Go to next message
msg2ajay
Messages: 51
Registered: June 2007
Location: KUALA LUMPUR
Member
hi,
i am getting an error message when i am using the following query.


 select     name,
            actno,
            countrycd,
            curcd,
            amtfin,
            settamt
from    ifmr
where   actcls IN('2','3')
group by prodcd;  



-------
|OUTPUT |
-------
select name,
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression



Is there any thing wrong in my approach.....?

thx,
Ajay
Re: GROUP BY is showing error [message #248066 is a reply to message #248065] Wed, 27 June 2007 23:37 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>Is there any thing wrong in my approach.....?
>ORA-00979: not a GROUP BY expression
Where/why is/did prodcd get included?
Re: GROUP BY is showing error [message #248068 is a reply to message #248065] Wed, 27 June 2007 23:49 Go to previous messageGo to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

Where have you used your group by function?.
Re: GROUP BY is showing error [message #248069 is a reply to message #248065] Wed, 27 June 2007 23:54 Go to previous messageGo to next message
msg2ajay
Messages: 51
Registered: June 2007
Location: KUALA LUMPUR
Member
select     name,
            actno,
            countrycd,
            curcd,
            amtfin,
            settamt
from    ifmr
where   actcls IN('2','3')
group by prodcd;  



in the abouve query i have user "GORUP BY PRODCD". The PRODCD will be having some group value for ex:
I001,
I002,
I003... so on.....
i need to get by group....
thx
Ajay
Re: GROUP BY is showing error [message #248070 is a reply to message #248069] Thu, 28 June 2007 00:04 Go to previous messageGo to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

http://www.w3schools.com/sql/sql_groupby.asp

Go through this link.
Re: GROUP BY is showing error [message #248075 is a reply to message #248069] Thu, 28 June 2007 00:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Explain in words what you want to do.
With what you posted, there is no need of a "group by" clause.
Maybe a "distinct"? who knows the original problem?

Regards
Michel
Re: GROUP BY is showing error [message #248302 is a reply to message #248075] Thu, 28 June 2007 10:28 Go to previous message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Quote:

I001,
I002,
I003... so on.....
i need to get by group....
thx


are you want to diplay result ASC DECE??
Then use ORDER BY...
Previous Topic: TABLESPACE SIZE
Next Topic: single quots problem
Goto Forum:
  


Current Time: Sun Dec 04 00:18:28 CST 2016

Total time taken to generate the page: 0.07591 seconds