Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

oracle query

Posted on 2012-03-30
4
374 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 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 37788360
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
ID: 37788374
I also want one more column end time minus start time as tot hrs (8.25)
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37788388
>>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
ID: 37788433
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle 10g standard edition server with 4 processors 3 67
PL SQL Search Across Columns 4 53
oracle- set role and grant privileges 6 38
UTL_FILE invalid file operation 5 28
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

829 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