Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement
Whenever mod(rownum,5) results in 0 it is translated rownum otherwise to
NULL.
This looks like rownum is to be displayed on every 5th row.
Note : mod(rownum,5) returns the remainder when rownum is divided by 5.
Hope that helps
Tay, Virginia wrote in message <97712538_at_NEWS.SAIC.COM>...
>Hi,
>
>Can someone explain the following SQL statement for me...Especially.....the
>DECODE functon....Why do I need to put a 'O' right after MOD...???
>
>select title, doc_category, decode(mod(rownum,5),0,rownum,null)
>from fieldd0200
>
>Thanks in advance!!!
>
>Ben
>
>
Received on Tue Jul 20 1999 - 17:23:44 CDT
![]() |
![]() |