Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 09 Sep 2004 @ 06:34:48 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


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



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023