pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Ashish Ahlawat <ahlawat.ashish@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Using Control Flow Functions in a SELECT Statement
Date: Mon, 4 Dec 2006 08:30:55 -0800 (PST)
Message-ID: <81103.2480.qm@web31804.mail.mud.yahoo.com> (raw)
In-Reply-To: <682126990612040821p88a04d7la2a230901d118921@mail.gmail.com>

> *ORA: 00907: Missing right parenthesis*
> Query :-
> SELECT Name AS Title, StatID AS Status, RatingID AS Rating,
> IF(NumDisks>1, 'Check for extra disks!', 'Only 1 disk.') AS Verify

What kind of error is ORA?  Is this an oracle error?

In postgresql I do not believe that the "IF" predicate exists.  However the "CASE" predicate does
and will do what you want.

http://www.postgresql.org/files/documentation/books/aw_pgsql/node44.html

Regards,

Richard Broersma Jr.



view thread (6+ messages)  latest in thread

Message-ID: <81103.2480.qm@web31804.mail.mud.yahoo.com>
Permalink:  ../81103.2480.qm@web31804.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/81103.2480.qm@web31804.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, ahlawat.ashish@gmail.com
  Subject: Re: Using Control Flow Functions in a SELECT Statement
  In-Reply-To: <81103.2480.qm@web31804.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox