Mar 15, 2004 #1 jlindahl Programmer Sep 23, 2003 46 US Can xor be used in sql statements? If not, is there a way I can get one or the other, but not both to be true?
Can xor be used in sql statements? If not, is there a way I can get one or the other, but not both to be true?
Mar 15, 2004 #2 dnoeth Instructor Oct 16, 2002 545 DE where (first_condition and not second_condition) or (second_condition and not first_condition) or where (case when first_condition then 1 else 0 end + case when second_condition then 1 else 0 end) = 1 or select * from ( select col1, col2, ... from tab where first_condition union all select col1, col2, ... from tab where second_condition ) dt group by col1, col2, ... having count(*) = 1 Dieter Upvote 0 Downvote
where (first_condition and not second_condition) or (second_condition and not first_condition) or where (case when first_condition then 1 else 0 end + case when second_condition then 1 else 0 end) = 1 or select * from ( select col1, col2, ... from tab where first_condition union all select col1, col2, ... from tab where second_condition ) dt group by col1, col2, ... having count(*) = 1 Dieter