Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I know how many same orderno is shown in rows sequentially?
Yes, I missed that. That is a tricky one! Off hand, I am pretty sure
this will work. But it will not result in a tidy result like you have
just mentioned. I am tempted to say that you have to write a PL/SQL
block and order it by seqno and check for orderno break and take the
count at that point, and then reset the count.
The brute force method is to do this in sqlplus using its formatting and reporting functions.
SQL>break on orderno SQL>compute count on seqno SQL>select orderno,seqno from <table>
orderno seqno LM001 1 2 ******** -------------- Count 2
and so on with the rest.
Regards,
z1hou1
Received on Sun Oct 07 2007 - 23:13:49 CDT
![]() |
![]() |