Click here to Skip to main content
16,005,552 members
Home / Discussions / Database
   

Database

 
AnswerRe: sql Query help Pin
Richard Deeming9-Aug-17 1:19
mveRichard Deeming9-Aug-17 1:19 
GeneralRe: sql Query help Pin
venu6569-Aug-17 17:54
venu6569-Aug-17 17:54 
GeneralRe: sql Query help Pin
Richard Deeming10-Aug-17 0:49
mveRichard Deeming10-Aug-17 0:49 
QuestionSQL boolean comparison Pin
User 1106097926-Jul-17 21:25
User 1106097926-Jul-17 21:25 
AnswerRe: SQL boolean comparison Pin
Richard MacCutchan26-Jul-17 22:03
mveRichard MacCutchan26-Jul-17 22:03 
GeneralRe: SQL boolean comparison Pin
User 1106097926-Jul-17 22:40
User 1106097926-Jul-17 22:40 
GeneralRe: SQL boolean comparison Pin
Richard MacCutchan26-Jul-17 22:48
mveRichard MacCutchan26-Jul-17 22:48 
JokeRe: SQL boolean comparison Pin
User 1106097926-Jul-17 23:14
User 1106097926-Jul-17 23:14 
GeneralRe: SQL boolean comparison Pin
User 1106097927-Jul-17 22:40
User 1106097927-Jul-17 22:40 
GeneralRe: SQL boolean comparison Pin
Richard MacCutchan27-Jul-17 22:59
mveRichard MacCutchan27-Jul-17 22:59 
GeneralRe: SQL boolean comparison Pin
Member 133967936-Sep-17 14:04
Member 133967936-Sep-17 14:04 
AnswerRe: SQL boolean comparison Pin
Mycroft Holmes26-Jul-17 22:23
professionalMycroft Holmes26-Jul-17 22:23 
GeneralRe: SQL boolean comparison Pin
User 1106097926-Jul-17 22:42
User 1106097926-Jul-17 22:42 
AnswerRe: SQL boolean comparison Pin
Richard Deeming27-Jul-17 1:41
mveRichard Deeming27-Jul-17 1:41 
You need a logical operator to combine two boolean conditions.

In this example, you'd want the Xor operator. But unfortunately, MS SQL Server doesn't support it; it only provides a bitwise Xor operator, which won't work here.

You can either use CASE, as Mycroft suggested, or the longhand version of Xor:
a XOR b <==> (a AND (NOT b)) OR ((NOT a) AND b)
SQL
... WHERE ((TBL1.INTFIELD Is Null And TBL2.INTFIELD Is Not Null) Or (TBL1.INTFIELD Is Not Null And TBL2.INTFIELD Is Null))




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: SQL boolean comparison Pin
User 1106097927-Jul-17 1:53
User 1106097927-Jul-17 1:53 
GeneralRe: SQL boolean comparison Pin
User 1106097927-Jul-17 22:41
User 1106097927-Jul-17 22:41 
QuestionSQL Linq, getting 3 of each record. Pin
jkirkerx24-Jul-17 10:16
professionaljkirkerx24-Jul-17 10:16 
AnswerRe: SQL Linq, getting 3 of each record, [WAIT] Pin
jkirkerx24-Jul-17 10:29
professionaljkirkerx24-Jul-17 10:29 
JokeRe: SQL Linq, getting 3 of each record, [WAIT] Pin
Afzaal Ahmad Zeeshan24-Jul-17 10:40
professionalAfzaal Ahmad Zeeshan24-Jul-17 10:40 
AnswerRe: SQL Linq, getting 3 of each record. Pin
Afzaal Ahmad Zeeshan24-Jul-17 10:36
professionalAfzaal Ahmad Zeeshan24-Jul-17 10:36 
QuestionIF then ? Pin
patsq19-Jul-17 12:00
patsq19-Jul-17 12:00 
AnswerRe: IF then ? Pin
PIEBALDconsult19-Jul-17 13:01
mvePIEBALDconsult19-Jul-17 13:01 
QuestionRe: IF then ? Pin
Richard MacCutchan19-Jul-17 21:51
mveRichard MacCutchan19-Jul-17 21:51 
AnswerRe: IF then ? Pin
patsq20-Jul-17 2:23
patsq20-Jul-17 2:23 
AnswerRe: IF then ? Pin
Richard Deeming20-Jul-17 1:36
mveRichard Deeming20-Jul-17 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.