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!

avoid querying same table twice

766559Apr 21 2010 — edited Apr 22 2010
Hi,

I have a table grade_master
grd_code              grd_osm_code

17                           10
18                           10
....
20                           15
21                           15
I want to get all the grd_code having same grd_osm_code for a given grd_code
say if i give grd_code 17, i should get 17 and 18

Using the query , i can do that. but i dont want to query the same table two times, thats the requirement
select grd_code from grade_master where grd_osm_code =(select grd_osm_code from grade_master where grd_code =17)
Any help

Edited by: user12984479 on Apr 21, 2010 3:35 AM
This post has been answered by 767793 on Apr 21 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2010
Added on Apr 21 2010
16 comments
2,315 views