Home » SQL & PL/SQL » SQL & PL/SQL » Date Query
Date Query [message #260256] Fri, 17 August 2007 16:18 Go to next message
yashora
Messages: 39
Registered: August 2006
Member
I have a table "xyz" with the following columns.

EMPNO SAL HDATE
----------------------------------

1 10000 12-JAN-2007
1 11000 12-MAR-2007
1 12000 12-JUN-2007

In the month of January, his salary is 11000. And there is no change in the salary till March. So i should get the output 12-FEB-2007 his salary is 10000.Likewise, there is no hike till August. So, april,may,june,july 12th dates should come into picture with 11000 as salary. How to do this with SQL command?

Output:
------


EMPNO SAL HDATE
--------------------------------
1 10000 12-JAN-2007
1 10000 12-FEB-2007
1 11000 12-MAR-2007
1 11000 12-APR-2007
1 11000 12-MAY-2007
1 12000 12-JUN-2007

Thanks in advance.

Yora






Re: Date Query [message #260266 is a reply to message #260256] Fri, 17 August 2007 17:23 Go to previous message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Please read the sticky before you post it.
Please format your post.
Also please search in the forum before you post your question.
Check this link
http://www.orafaq.com/forum/m/223853/94420/?srch=missing+dates#msg_223853
Previous Topic: how to retrieve a rollbacked data?
Next Topic: dbms_job problem
Goto Forum:
  


Current Time: Sat Dec 03 16:14:28 CST 2016

Total time taken to generate the page: 0.06752 seconds