Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

view in punch and out punch in different columns

Krishna Devi VinayakaAug 17 2014 — edited Sep 17 2014

I don't know whether it is possible in oracle..

I am sorry if it is a stupid question..

I want a query to view in punch and out punch of employees in two columns.

My table looks like..

-------------------------------------------------------------------------------------

Employee_ID             Punch_time                 Punch_type

-------------------------------------------------------------------------------------

1                              01/04/2014 9:00           in

1                              01/04/2014 5:00           out

1                              02/04/2014 5:00           out

1                              03/04/2014 9:00           in

1                              04/04/2014 9:00           in

--------------------------------------------------------------------------------------------

I want the out put as

-------------------------------------------------------------------------------------

Employee_ID             IN                              OUT

-------------------------------------------------------------------------------------

1                              01/04/2014 9:00          01/04/2014 5:00

1                               null                           02/04/2014 5:00         

1                              03/04/2014 9:00          null

1                              04/04/2014 9:00          null

--------------------------------------------------------------------------------------------

I want to create view as above.

I know it can be done through a programming language and insert into a table.  But that wouldn't be useful for me.

Because i will have to insert punches in the middle (Example if an employee forget a punch and request to regularise).

In that case i will have to reprocess all the punches ..

In order to avoid this i am looking for a view..

Is it possible to create a view as mentioned above?

Please help..

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2014
Added on Aug 17 2014
8 comments
3,192 views