Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How can I know how many same orderno is shown in rows sequentially?

Re: How can I know how many same orderno is shown in rows sequentially?

From: z1hou1 <z1hou1_at_gmail.com>
Date: Mon, 08 Oct 2007 04:11:56 -0000
Message-ID: <1191816716.198479.261600@o3g2000hsb.googlegroups.com>


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>

The output is there, but as mentioned earlier, not the way you want it.
orderno       seqno
LM001              1
                        2
********  --------------
Count               2

and so on with the rest.

Regards,
z1hou1 Received on Sun Oct 07 2007 - 23:11:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US