SQL- ROWNUM
706043Dec 24 2009 — edited Dec 25 2009Hello All and Happy Holidays....I just wanted to get a better understanding of ROWNUM, I was reading about ROWNUM in oracle discussion and was a little confuse.
If I have the following:
select customer1.cus_id,customer1.cus_name,customer_phone1.phone_id,phone1.phone_num,phone_location1.phone_id,phone_location1.loc_id,location1.loc_area
from
customer1 inner join customer_phone1 on customer1.cus_id=customer_phone1.cus_id
inner join phone1 on customer_phone1.phone_id=phone1.phone_id
inner join phone_location1 on phone_location1.phone_id=phone1.phone_id
INNER JOIN location1 on phone_location1.loc_id=location1.loc_id
where rownum<=100;
What I am trying to do is get all the tables to join , but once it join 100 rows, I want it to exit.
Not sure if the above code is correct or maybe I should put bracker after the FROM and before the WHERE clause?
Any recommendation?
thanks ,