I have a problem in writing sql query. Here is the illustration about my problem.
I have 2 tables in the database as follows :
| Table A | | Table B |
| idTableA | | idTableB |
| idPriority | | idReference |
Those tables above are related. The idReference in Table B is referring to idPriority in Table A. BUT if the value of the idPriority is NULL, then the idReference should be referring to idTableA. Hope you guys get the illustration and can help me working with this problem. Thx in advance.
Double-join method, easy to read
Single-join method, two IsNulls()’s: