Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 06E539FA324 for ; Mon, 4 Dec 2006 12:42:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 35390-10 for ; Mon, 4 Dec 2006 12:42:54 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 0ED5F9FA38F for ; Mon, 4 Dec 2006 12:42:52 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so2723547ugf for ; Mon, 04 Dec 2006 08:42:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=W++rokhS6BWxF4IqP+dYIkIjesyOAyBWUjQELxI9RCTUH39I5sOZ9tKDqsVfBVrFKVclWlQMMu1oxdiLLrEi6++6Bjek9qf/7pjBVO8GwFo/peuTmfXyAs2iioF/fpmYOfn9a1NJfEXuIzXwbCMfZvbvgqlgthCyUOufftRMCkk= Received: by 10.78.138.6 with SMTP id l6mr7813144hud.1165250570342; Mon, 04 Dec 2006 08:42:50 -0800 (PST) Received: by 10.78.150.17 with HTTP; Mon, 4 Dec 2006 08:42:49 -0800 (PST) Message-ID: <682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com> Date: Mon, 4 Dec 2006 22:12:49 +0530 From: "Ashish Ahlawat" To: "Bricklen Anderson" Subject: Re: Using Control Flow Functions in a SELECT Statement Cc: "Bruce Momjian" , "Ken Johanson" , "Martijn van Oosterhout" , pgsql-sql@postgresql.org, pgsql-sql-owner@postgresql.org, tgl@sss.pgh.pa.us In-Reply-To: <45744D85.9050107@presinet.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_31763_14424661.1165250569981" References: <682126990612040821p88a04d7la2a230901d118921@mail.gmail.com> <45744D85.9050107@presinet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/45 X-Sequence-Number: 27001 ------=_Part_31763_14424661.1165250569981 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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. > > ------=_Part_31763_14424661.1165250569981 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

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.


------=_Part_31763_14424661.1165250569981--