Re: Using Control Flow Functions in a SELECT Statement - Mailing list pgsql-sql

From Ashish Ahlawat
Subject Re: Using Control Flow Functions in a SELECT Statement
Date
Msg-id 682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com
Whole thread Raw
In response to Re: Using Control Flow Functions in a SELECT Statement  (Bricklen Anderson <banderson@presinet.com>)
Responses Re: Using Control Flow Functions in a SELECT Statement  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: Using Control Flow Functions in a SELECT Statement  (Ragnar <gnari@hive.is>)
List pgsql-sql

Hi Team

Thanks FOR your prompt response....But USING CASE issue still NOT resolved....Oracle prompts same error .

Team its a simple query but really instresting one...

Following data has been updated IN TABLE DVDs

INSERT INTO DVDs (Name, NumDisks, RatingID, StatID)

VALUES('Mash', 2, 'R', 's2'), ('View', 1, 'NR', 's1'), ( 'Show', 2, 'NR' , 's2'), ('Amadeus' , 1, 'PG' , 's2') , ('Falcon', 1, 'NR', 's2'),

('Africa', 1, 'PG', 's1'), ('Doc', 1, 'G', 's2') , ('Christmas', 1 , 'NR', 's1');

On 12/4/06, Bricklen Anderson <banderson@presinet.com> wrote:
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.


pgsql-sql by date:

Previous
From: Bricklen Anderson
Date:
Subject: Re: Using Control Flow Functions in a SELECT Statement
Next
From: Richard Broersma Jr
Date:
Subject: Re: Using Control Flow Functions in a SELECT Statement