开发者

SQLPlus - Count function across several tables

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 E开发者_如何学Pythonxtravaganza               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;


Are you looking for something like:

SELECT COUNT(riders) AS rider_count, eventname, description
  FROM erp_report
  GROUP BY eventname, description;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜