Re: Using Control Flow Functions in a SELECT Statement

From: Bricklen Anderson <banderson(at)presinet(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:32:05
Message-ID: 45744D85.9050107@presinet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Ashish Ahlawat wrote:
>
> Hi Team
>
> I am unable to fetch data using following simple query it prompts
> following error
>
> *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
>

i. That's an Oracle error message.
ii. IF does not belong in an SQL query. Use CASE.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ashish Ahlawat 2006-12-04 16:42:49 Re: Using Control Flow Functions in a SELECT Statement
Previous Message Richard Broersma Jr 2006-12-04 16:30:55 Re: Using Control Flow Functions in a SELECT Statement