From: Brian C. Doyle <bcdoyle@mindspring.com>
To: pgsql-sql@postgresql.org
Subject: Sub-Select in CASE
Date: Mon, 01 Apr 2002 12:47:30 -0500
Message-ID: <5.1.0.14.2.20020401124436.02aaf1c0@proxy> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bcdoyle@mindspring.com
Subject: Re: Sub-Select in CASE
In-Reply-To: <5.1.0.14.2.20020401124436.02aaf1c0@proxy>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox