views:

209

answers:

1

hello, i am trying to count the number of riders in my data. and i am having trouble figuring this out. sample of my output is noted below. The data comes from many different tables and I had to join the tables which is not the problem I am having. I am trying to get the count number of RIDERS by EVENT by DESCRIPTION. And still display the columns as noted below.

SQL> SELECT EVENTNAME, DESCRIPTION, RIDERS2  FROM ERP_REPORT;

EVENTNAME              DESCRIPTION                              RIDERS
------------------------------ ------------------------------ 
Ace Rental Car - Fair Hill Inv Day 1 Race on Fair Hill's Easy   Aaron Adams
itational                       level Course

Ace Rental Car - Fair Hill Inv Day 1 Race on Fair Hill's Easy   Aaron Adams
itational                       level Course

Ace Rental Car - Fair Hill Inv Day 2 Race on Fair Hill's Inte   Aaron Adams
itational                      rmediate level Course

Huffy's Mountain Trip          Weekend 1 Race 1 on Huffy Moun   Sam Adams
                           tain's Easy level Course

Valley Spring Water Mountain B Day 3 Race on Hoola Hut Gorge'   Jay Gillgan
ike Extravaganza               s Intermediate level Course

I have tried a bunch of different code but this is one Sample I have tried. I am lost on this so any help would huge!

SELECT COUNT(DISTINCT RIDERS) as "RIDERS"
2  FROM ERP_REPORT;
+2  A: 

Are you looking for something like:

SELECT COUNT(riders) AS rider_count, eventname, description
  FROM erp_report
  GROUP BY eventname, description;
outis
Amazing... I see where I was went wrong as well. thanks you so much!
Michael