Solved

oracle query

Posted on 2012-03-30
4
363 Views
Last Modified: 2012-03-30
select ds.schedule_date,ds.start_hours||':'||ds.start_minutes||ds.start_ampm start_time,  
       ds.end_hours||':'||ds.end_minutes||'0'||ds.end_ampm end_time,
       first_name || ',' || mail_last_name new_name,
         ds.position,reason_code
from dept_staff ds, emp_unexcld eu
where ds.payroll_id = eu.payroll_id
and ds.schedule_date = '01-apr-2012'
order by schedule_date,ds.start_time,mail_last_name
-----------------------------------
SCHEDULE_DATE  START_TIME  END_TIME NEW_NAME           POSITION  REASON_CODE
4/1/2012        5:45A         2:00P  Barbara A,Ardelean   SRPM      SH
4/1/2012        5:45A         2:00P  Nichole S,Baines     PHMB      SH
4/1/2012        5:45A         2:00P  Thomas A,Cutter      TLMB      SH
4/1/2012        5:45A         2:00P  Adrian A,Fis         TLMB      SH
4/1/2012        5:45A         2:00P  Mandy,Lemke          PHMB      SH
4/1/2012        5:45A         2:00P  Nancy M,Penna        PHMB      SH
4/1/2012        5:45A         2:00P  Nyisha D,Richardson  SRPM      SH
-----------------In the Beginning I want Day - Sunday and then schedule_date, start_time
April 2nd is a Monday and I want Monday and then schedule_date
0
Comment
Question by:anumoses
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
Comment Utility
Add it with to_char?

select to_char(ds.schedule_date,'Day'),ds.schedule_date,ds.start_hours||':'||ds.start_minutes
0
 
LVL 6

Author Comment

by:anumoses
Comment Utility
I also want one more column end time minus start time as tot hrs (8.25)
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
>>I also want one more column end time minus start time

That wasn't part of this question.

Anyway: so add it.  Isn't that the output from your previous question?  Just incorporate that logic into this query.  It should just be another column.
0
 
LVL 6

Author Closing Comment

by:anumoses
Comment Utility
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now