Thanks to visit codestin.com
Credit goes to postgrespro.com

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

From Bricklen Anderson
Subject Re: Using Control Flow Functions in a SELECT Statement
Date
Msg-id [email protected]
Whole thread Raw
In response to Using Control Flow Functions in a SELECT Statement  ("Ashish Ahlawat" <[email protected]>)
Responses Re: Using Control Flow Functions in a SELECT Statement
List 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.



pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Using Control Flow Functions in a SELECT Statement
Next
From: "Ashish Ahlawat"
Date:
Subject: Re: Using Control Flow Functions in a SELECT Statement