Sub-Select in CASE - Mailing list pgsql-sql

From Brian C. Doyle
Subject Sub-Select in CASE
Date
Msg-id 5.1.0.14.2.20020401124436.02aaf1c0@proxy
Whole thread Raw
List pgsql-sql
Hello all,

I am trying to run a query that checks to see if a mail box exist in a 
db.  If the mail box does not exist i need it to return another address.

Currently I am working with :

SELECT CASE WHEN alias.mbox='brian' THEN alias.email_add  ELSE (SELECT 
alias.email_add WHERE alias.mbox='*' AND alias.domain='domain.com) END 
WHERE alias.domain='domain.com' and alias.mbox='brian';


I am not even sure if Case is the best choice.

More background info on it, this is for and db that EXIM enter acts with 
and i want to be able to setup a default alias.



pgsql-sql by date:

Previous
From: Mathieu Arnold
Date:
Subject: optimyzing
Next
From: "Dan Langille"
Date:
Subject: selecting records from a date range