Home » SQL & PL/SQL » SQL & PL/SQL » Query
Query [message #618800] Tue, 15 July 2014 13:28 Go to next message
simiha
Messages: 1
Registered: July 2014
Junior Member
Hello

Can anyone can help me.

task:

Table A has Intime, outtime, earncode, hour, empcode.
data has 1/22/2014 8:00:00am, 1/22/2014 4:00:00pm, Holiday, 8,10002
1/22/2014 12:00:00pm, 1/22/2014 3:00:00:00pm, Regular, 3,10002
1/23/2014 8:00:00am, 1/23/2014 12:00:00pm, null, 4, 10003
1/23/2014 1:00:00am, 1/23/2014 4:00:00pm, Sick, 3, 10003
1/24/2014 8:00:00am, 1/24/2014 12:00:00pm, null, 4, 10004
1/24/2014 1:00:00am, 1/24/2014 4:00:00pm, null, 3, 10004

......
we have records like this around 10000000

I have to get whoever in earncode is null, not null which means have to get only if the person on earncode is holiday then need to get next row even if it null or not null.
No need to get like this Remaining rows as empcode 10004 since there is no earn code and it is regular work hours.

Please anyone reply me as earlier as possible.

thanks
simi



Re: Query [message #618802 is a reply to message #618800] Tue, 15 July 2014 13:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
welcome to this forum.


Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and please read http://www.orafaq.com/forum/t/174502/102589/
Re: Query [message #618812 is a reply to message #618800] Tue, 15 July 2014 15:07 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
Before, Please How to use [code] tags and make your code easier to read.

Previous Topic: How to check words from two columns in a table and give count
Next Topic: Prior Week Saturday Date
Goto Forum:
  


Current Time: Sat Apr 20 08:26:23 CDT 2024