-
select nct.user_id,count(so.order_no) as ordercount
from NETCARROTS_TRANSACTIONS nct, cust_info ci, shopcart_order so
where nct.user_id=ci.user_id and status='y' and so.order_no=nct.order_no
and so.dateorder between '01-feb-2002'
and '01-apr-2002' group by nct.user_id
order by ordercount desc
the above query return 15 rows i want to retrive top 5 out of this resultset... but i am not able to get ... is there any to do this...
thanks
-
Top five or first five?
Add "where rownum < 6" to get first five rows.
-
no i want top 5 rows...... and rownum is not working in this case don't know why.....
-
select * from (
select nct.user_id,count(so.order_no) as ordercount
from NETCARROTS_TRANSACTIONS nct, cust_info ci, shopcart_order so
where nct.user_id=ci.user_id and status='y' and so.order_no=nct.order_no
and so.dateorder between '01-feb-2002'
and '01-apr-2002' group by nct.user_id
order by ordercount desc )
where rownum < 6
Santosh Jadhav
8i OCP DBA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|