June 3, 2010 at 9:26 am
Man, it's been a while since I posted!
Simple question: is there such a thing as an exclusive OR in T-SQL?
I didn't see anything in BOL, so I figured I'd ask the gallery to see if anyone knew anything about this.
+--------------------------------------------------------------------------------------+
Check out my blog at https://pianorayk.wordpress.com/
June 3, 2010 at 9:33 am
I believe that you're looking for "^" (bitwise Exclusive OR) operator.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:47 am
Thanks for the assist; unfortunately, it didn't work for me. (Sorry, I should have been a little more specific; my fault.)
Here's my scenario: I wrote a SP, and I'm struggling with the WHERE condition logic. I was just thinking how much easier my life would be if there was an XOR or its equivalent.
If anyone reading this is curious about what I'm trying to solve, I'll create a new topic (in which it's more appropriate) and post a link to it.
+--------------------------------------------------------------------------------------+
Check out my blog at https://pianorayk.wordpress.com/
June 3, 2010 at 9:55 am
You could replicate the functionality I guess with something like:
WHERE (Col1=X OR Col2=Y) AND NOT (Col1=X AND Col2=Y)
.
June 3, 2010 at 9:59 am
HowardW (6/3/2010)
You could replicate the functionality I guess with something like:
WHERE (Col1=X OR Col2=Y) AND NOT (Col1=X AND Col2=Y)
.
I thought about that, but that could get messy.
I'm working on putting together some sample data to post. As soon as I'm done, I'll start a new thread and post a link to it.
+--------------------------------------------------------------------------------------+
Check out my blog at https://pianorayk.wordpress.com/
June 3, 2010 at 11:13 am
As promised, here's the link to my new thread.
+--------------------------------------------------------------------------------------+
Check out my blog at https://pianorayk.wordpress.com/
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply