pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashish Ahlawat <ahlawat.ashish@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ken Johanson <pg-user@kensystem.com>
Cc: Martijn van Oosterhout <kleptog@svana.org>
Cc: pgsql-sql@postgresql.org
Subject: Using Control Flow Functions in a SELECT Statement
Date: Mon, 4 Dec 2006 21:51:57 +0530
Message-ID: <682126990612040821p88a04d7la2a230901d118921@mail.gmail.com> (raw)

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

FROM DVDs



*Table Structure :-*

CREATE TABLE DVDs (

Name VARCHAR(60) NOT NULL,

NumDisks INT NOT NULL ,

RatingID VARCHAR(4) NOT NULL,

StatID CHAR(3) NOT NULL

)

rows has been inserted with different numdisks numbers.  pls help

warm R's

view thread (6+ messages)  latest in thread

Message-ID: <682126990612040821p88a04d7la2a230901d118921@mail.gmail.com>
Permalink:  ../682126990612040821p88a04d7la2a230901d118921@mail.gmail.com/
Also on:    postgresql.org/message-id/682126990612040821p88a04d7la2a230901d118921@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, bruce@momjian.us, tgl@sss.pgh.pa.us, pg-user@kensystem.com, kleptog@svana.org
  Subject: Re: Using Control Flow Functions in a SELECT Statement
  In-Reply-To: <682126990612040821p88a04d7la2a230901d118921@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