Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement
Hi
DECODE is just another form of (IF THEN ELSE)
IF A=B THEN X
IF A=C THEN Y
ELSE Z;
Your example:
IF decode(mod(rownum,5), = 0 THEN ROWNUM ELSE NULL; Hope this helps
Mohamed
"Tay, Virginia" wrote:
> 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 Thu Jul 29 1999 - 12:01:12 CDT
![]() |
![]() |