Home » SQL & PL/SQL » SQL & PL/SQL » How to get department wise effective rate
How to get department wise effective rate [message #599620] Sat, 26 October 2013 22:31 Go to next message
lavkumar78
Messages: 9
Registered: June 2013
Location: delhi
Junior Member

Hello friends

1) First Table

Id , Name , Eff_date
10 I1 15-APR-2013
20 I2 30-APR-2013
30 I3 26-May-2013
20 I4 10-SEP-2013
40 I5 10-sep-2013
40 I6 10-Oct-2013

2) Second Table

Eff date Rate
15-APR-2013 900
30-APR-2013 500
16-Sep-2013 400
05-Oct-2013 200


Q. How to get department wise effective rate ?


Re: How to get department wise effective rate [message #599621 is a reply to message #599620] Sat, 26 October 2013 22:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you provided DDL (CREATE TABLE ...) for tables involved.
It would be helpful if you provided DML (INSERT INTO ...) for test data.
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/311
It would be helpful if you provided expected/desired results & a detailed explanation how & why the test data gets transformed or organized.
icon5.gif  Re: How to get department wise effective rate [message #599627 is a reply to message #599620] Sun, 27 October 2013 02:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What is "effective rate"?
What should be the result for your data?

Re: How to get department wise effective rate [message #599632 is a reply to message #599620] Sun, 27 October 2013 05:39 Go to previous message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
Use analytic LEAD eff_date on first table and then join it to second table using BETWEEN condition.

SY.
Previous Topic: EMP and DEPT Tables
Next Topic: SQL IN FUNCTION
Goto Forum:
  


Current Time: Thu Apr 18 03:22:25 CDT 2024