Thread: Sub-Select in CASE

Sub-Select in CASE

From
"Brian C. Doyle"
Date:
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.