Archives of the TeradataForum
Message Posted: Thu, 09 Sep 2004 @ 06:34:48 GMT
| Subj: | | Re: XOR |
| |
| From: | | Dieter Noeth |
Simard Rudel wrote:
| | Do you have an idea how to implement a 'Exclusive-Or function' in SQL Teradata? | |
| | I sent to you a exemple of what I would like to have : | |
> select *
> from View1
> where (fiel1 IS NULL XOR fiel2 IS NULL)
| | Where XOR means 'Exclusive-Or function' | |
If it's more than two (or complex) conditions the following might be easily expanded:
select *
from View1
where
(case when fiel1 is null then 1 else 0 end) +
(case when fiel2 is null then 1 else 0 end) = 1
Dieter
|