TYPICAL QUERY..Experts ?? [message #227287] |
Tue, 27 March 2007 20:58 |
parlovi
Messages: 6 Registered: February 2007 Location: BANGALORE
|
Junior Member |
|
|
Hi All,
Recently I came across a stuff to write query for below scenario.
There are two tables and their structure is as below.
Create table EMP (eno ,ename ,sal) - 2rows
Create table GRAD ( grads, Low ,High ) - 3 rows
values for EMP values for GRAD
ENO ENAME SAL GRAD LOW HIGH
1 X 1000 1 1000 5000
2 Y 10000 2 5001 7500
3 7501 10000
So as u can see here GRAD table contains grad of employee for different salary range.
I have to write a query which gives in output ENAME,SAL & GRAD for that employee i.e in which grad his/her salary lies.
I tried to do it in joins and correlated sub query but I was not able to do it better.
Can someone plz Help here ?
Thanks for your efforts.
Regards,
P
[Updated on: Tue, 27 March 2007 21:00] Report message to a moderator
|
|
|
|
|
|