GROUP BY & ROWNUM [message #374929] |
Thu, 12 July 2001 05:26 |
Pavel Aksonov
Messages: 4 Registered: July 2001
|
Junior Member |
|
|
I wonder that query "select * from tab group by id rownum<=500" which contains more than 500 records show only 117 records. I think it's because of "GROUP BY" statement. How I can limit to exact 500 records my output? Please help.
|
|
|
|
Re: GROUP BY & ROWNUM [message #374950 is a reply to message #374929] |
Fri, 13 July 2001 09:06 |
Sudhakar Atmakuru
Messages: 58 Registered: May 2001
|
Member |
|
|
Rownum would work properly when you dont use = operator in the query. Try the same with ROWNUM<501 then it should give your desired result, I guess. As per my experience, the ROWNUM does not work properly when it is given with = or BETWEEN operator.
Try it out. Hope it works for you.
|
|
|
Re: GROUP BY & ROWNUM [message #374951 is a reply to message #374929] |
Fri, 13 July 2001 09:08 |
Sudhakar Atmakuru
Messages: 58 Registered: May 2001
|
Member |
|
|
Rownum would work properly when you dont use = operator in the query. Try the same with ROWNUM<501 then it should give your desired result, I guess. As per my experience, the ROWNUM does not work properly when it is given with = or BETWEEN operator.
Try it out. Hope it works for you.
|
|
|