SQL CASE Statements

Поиск
Список
Период
Сортировка
От Lane Van Ingen
Тема SQL CASE Statements
Дата
Msg-id EKEMKEFLOMKDDLIALABIOEIOCBAA.lvaningen@esncc.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Ferindo Middleton Jr
Дата:
Сообщение: Re: How to secure PostgreSQL Data for distribute?
Следующее
От: "Dmitri Bichko"
Дата:
Сообщение: Re: SQL CASE Statements