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: SQL Statement

Re: SQL Statement

From: Mohamed Hashim <mhashim_at_crc.ca>
Date: Thu, 29 Jul 1999 13:01:12 -0400
Message-ID: <37A088D8.3ED454F2@crc.ca>


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

Original text of this message

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