RE: [Exim] Syntax for a MySQL select true/false statement

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Eli
Dátum:  
Címzett: 'Hr. Daniel Mikkelsen'
CC: exim-users
Tárgy: RE: [Exim] Syntax for a MySQL select true/false statement
I was considering something of that sort, maybe using IFNULL(), however I
don't know how Exim determines a true/false from a SELECT statement? From
what I read, if it returns ANYTHING, it thinks it passed the condition, so I
guess *maybe* I could do something like:

SELECT 1 FROM users .... AND fwd IS NOT NULL

That would return "1" if the fwd address had something in it, and nothing if
it didn't. I was still hoping to know if there was a way to do what I was
asking without SQL stuff like this :) Just in case I ever have the need for
it later.

Eli.

-----Original Message-----
From: exim-users-admin@??? [mailto:exim-users-admin@exim.org] On Behalf
Of Hr. Daniel Mikkelsen
Sent: Wednesday, June 18, 2003 2:47 PM
To: Eli
Cc: exim-users@???
Subject: Re: [Exim] Syntax for a MySQL select true/false statement


On Wed, 18 Jun 2003, Eli wrote:

> Or whatever, but have it do a true/false depending on if the SELECT

returns
> NULL or NOT NULL (ie, an email address to forward to).
>
> Can someone show me the syntax for doing that if possible, and if not,

maybe
> suggest what an alternative is?


Can't you just do this in your select statement?

SELECT myvar1 = myvar2 OR myvar1 = 'foobar' FROM ...

I do stuff like this in my conditions with PostGreSQL at least. Don't
underestimate SQL. :)

-- Daniel


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##

---
[This E-mail scanned for viruses]


---
[This E-mail scanned for viruses]