From: Lane Van Ingen <lvaningen@esncc.com>
To: pgsql-sql@postgresql.org
Subject: SQL CASE Statements
Date: Thu, 18 Aug 2005 21:31:34 -0400
Message-ID: <EKEMKEFLOMKDDLIALABIOEIOCBAA.lvaningen@esncc.com> (raw)
In the following CASE statement, is it possible to put a SELECT ... WHERE
EXISTS
in the <condition> of a CASE statement, and have it work?
The <condition> I want to do is to yield a result of '1' if the statement
finds
the value 'a' in a table (EXISTS evaluates true), and '0' if it evaluates
false
('a' not found).
SELECT a,
CASE WHEN <CONDITION> THEN 1
ELSE 0
END
Has anybody done this? If so, can you send me a sample?
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: lvaningen@esncc.com
Subject: Re: SQL CASE Statements
In-Reply-To: <EKEMKEFLOMKDDLIALABIOEIOCBAA.lvaningen@esncc.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