huangs3
asked on
Oracle SQL: is there XOR condition?
Hi Experts:
Is there an XOR operator or something like that in Oracle SQL. I tried but couldn't find iit.
I want to write a SQL statement that can return records with exactly one fild assigned. For example, for the inputs:
************************** ********** ********** ********** *****
key_table
-------
ID
-------
a
b
c
-------
tableA tableB tableC
_________ ----------------- -----------------
ID parent ID parent ID parent
------------- ----------------- -----------------
1 a 2 a 3 b
4 b
************************** ********** ********** ********** ********** ********** ***
I want to return
************************** ********** ********** ********** ********** **
ID IDA IDB IDC
-------------------------- ---------- -----
a 1 null null
a null 2 null
b null null 3
b 4 null null
************************** ********** ********** ********** ********** ****
Thank you!
Is there an XOR operator or something like that in Oracle SQL. I tried but couldn't find iit.
I want to write a SQL statement that can return records with exactly one fild assigned. For example, for the inputs:
**************************
key_table
-------
ID
-------
a
b
c
-------
tableA tableB tableC
_________ ----------------- -----------------
ID parent ID parent ID parent
------------- ----------------- -----------------
1 a 2 a 3 b
4 b
**************************
I want to return
**************************
ID IDA IDB IDC
--------------------------
a 1 null null
a null 2 null
b null null 3
b 4 null null
**************************
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window