Page 1 of 1

Showing line number sequentially in invoice format

Posted: Tue Aug 26, 2008 1:50 am
by alvinhe
Hi,

I am doing customisation on customer invoice. I am facing difficulties when would like to showing line number sequentially. eg. One invoice has 5 items, my expectation is line no field should showing 1 for first item, 2 for second item, 3 for 3rd item and etc.

If not mistaken, it should write some formula to control right?

Appreciate if someone can advise on this.

Thanks in advanced.

Posted: Tue Aug 26, 2008 8:34 am
by MasterN
Suppose you have table1, in which you have invoice_no column.

Now you want to show invoice_no,srno .....if i m right then
write the following query to acheive the result.

SELECT INVOICE_NO,ROW_NUMBER() OVER (PARTITION BY INVOICE_NO ORDER BY ROWNUM) SRNO
FROM TABLE1

I Think you got the desired result.

If any query about this then contact with me for detail.

Thanks,
Farooq