SQL CASE Statements - Mailing list pgsql-sql

From Lane Van Ingen
Subject SQL CASE Statements
Date
Msg-id EKEMKEFLOMKDDLIALABIOEIOCBAA.lvaningen@esncc.com
Whole thread Raw
List pgsql-sql
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?




pgsql-sql by date:

Previous
From: Ferindo Middleton Jr
Date:
Subject: Re: How to secure PostgreSQL Data for distribute?
Next
From: "Dmitri Bichko"
Date:
Subject: Re: SQL CASE Statements