I am trying to create a query that has totals of a particular hour type by date. This is what I came up with:
(select ((sum(wrkd_minutes))/60) from work_detail where work_detail.htype_id = 2) as totalot1,
(select ((sum(wrkd_minutes))/60) from work_detail where work_detail.htype_id = 3) as totalot2,
(select ((sum(wrkd_minutes))/60) from work_detail, work_summary where
(work_detail.wrks_id = work_summary.wrks_id)
and (work_summary.wrks_authorized = 'N')) as totalua
from work_detail, hour_type
where work_detail.htype_id = hour_type.htype_id
group by work_detail.wrkd_work_date
The output rolls everything up into one total for all dates. How can I get totals for each day?
This is the output:
WRKD_WORK TOTALOT1 TOTALOT2 TOTALUA
--------- ---------- ---------- ----------
06-MAY-02 161.183333 1724.61667 18948.65
14-JUL-04 161.183333 1724.61667 18948.65
15-JUL-04 161.183333 1724.61667 18948.65
16-JUL-04 161.183333 1724.61667 18948.65
17-JUL-04 161.183333 1724.61667 18948.65
18-JUL-04 161.183333 1724.61667 18948.65
19-JUL-04 161.183333 1724.61667 18948.65
20-JUL-04 161.183333 1724.61667 18948.65
21-JUL-04 161.183333 1724.61667 18948.65
22-JUL-04 161.183333 1724.61667 18948.65
23-JUL-04 161.183333 1724.61667 18948.65
Thanks for your help!
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.
Your password has been sent to:firstname.lastname@example.org
To follow this tag...
Thanks! We'll email you when relevant content is added and updated.
Share this item with your network: