Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement
Yup. Show me the title, doc_category, and a number. If the remainder of
dividing the rownum by 5 is 0, then show me rownum, otherwise show me null.
In other words, show me the rownum for every fifth row. I'm not sure why
you'd want to do this, but that's what it does :=)
Regards,
--
David C. Sisk
The Unofficial ORACLE on NT site
http://www.ipass.net/~davesisk/oont.htm
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 Wed Jul 21 1999 - 08:08:19 CDT
![]() |
![]() |