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? ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org