Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with the query

Author  Topic 

rds207
Posting Yak Master

198 Posts

Posted - 2010-04-08 : 15:18:04
Hi i need to get the percentage of the jobs_by_cluster / total_jobs ...

i have 2 tables

1. dw_t_jobdata
2.dw_t_corp_employee

dw_t_jobdata:

cluster_name varchar2(128)
finish_time date
user_code INT
JOB_ID INT

dw_t_corp_employee:

user_code INT
office_site varchar 2(32)

I Need to display

Total Jobs - for a month,
Totaljobs by cluster name for that month and that particualr cluster,
(FINISH_DAY)MONTH- Grouped by Month,
% of the Jobs (which is jobs_by_cluster/total_job *100)
office_site

Here is the sample output expecting:

OFFICE_SITE MONTH CLUSTER_NAME Total_Jobs Jobs_by_cluster %

Raleigh, NC 4/1/2010 GBC 12 6 50%
Canada 4/1/2010 ICEng 30 10 33%
Raleigh, NC 4/1/2010 RTP 20 12 60%
India 4/1/2010 ICEng 40 10 25%

Please help






   

- Advertisement -