Re: Using Control Flow Functions in a SELECT Statement

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Ashish Ahlawat <ahlawat(dot)ashish(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using Control Flow Functions in a SELECT Statement
Date: 2006-12-04 16:30:55
Message-ID: 81103.2480.qm@web31804.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> *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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bricklen Anderson 2006-12-04 16:32:05 Re: Using Control Flow Functions in a SELECT Statement
Previous Message Ashish Ahlawat 2006-12-04 16:21:57 Using Control Flow Functions in a SELECT Statement