Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use DENSE_RANK()

Status
Not open for further replies.

JPCogAdmin

Programmer
May 22, 2006
110
US
Hi,

I'm trying to select fields and use the DENSE_RANK() over function to no avail. I keep getting an error that says: ORA-00937: "not a single-group group function".

I'm doing the following code:

select field1,count(*) CALLS,sum(minutes) MINS,DENSE_RANK() over (order b count(*) desc);

The other problem is that I can't use the "CALLS" alias because it also complains. Can someone shed light on how to use this function. Also what is partition by do? Thank you.

-JP
 
The problem is not with your dense_rank but your sum. You need to sum over somtheing in the same way as dense_rank.
 
Can you show exactly the sql since the example is mixing aggregate and single column values. It is not clear what the requirements of the sql are.
 
Group,

Thank you for your replies. I just figure it out. It had to have group by since I was issuing a count(*). Once I put in a group by it worked.

;-)

-JP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top