pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashish Ahlawat <ahlawat.ashish@gmail.com>
To: Bricklen Anderson <banderson@presinet.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Ken Johanson <pg-user@kensystem.com>
Cc: Martijn van Oosterhout <kleptog@svana.org>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-sql-owner@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: Using Control Flow Functions in a SELECT Statement
Date: Mon, 4 Dec 2006 22:12:49 +0530
Message-ID: <682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com> (raw)
In-Reply-To: <45744D85.9050107@presinet.com>
References: <682126990612040821p88a04d7la2a230901d118921@mail.gmail.com>
	<45744D85.9050107@presinet.com>

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

view thread (6+ messages)  latest in thread

Message-ID: <682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com>
Permalink:  ../682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com/
Also on:    postgresql.org/message-id/682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ahlawat.ashish@gmail.com, banderson@presinet.com, bruce@momjian.us, pg-user@kensystem.com, kleptog@svana.org, pgsql-sql-owner@postgresql.org, tgl@sss.pgh.pa.us
  Subject: Re: Using Control Flow Functions in a SELECT Statement
  In-Reply-To: <682126990612040842s136366d5wa3461535f93bb544@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox