I have 2 tables where I need to select records if the identifiers can be joined. There are 2 sets of identifiers...I want to compare the first ones and if they join, then select the record. If they don't match, try to join on the second identifier. If that doesn't work, then the record isn't selected.
Do I use a case statement in the where clause?
Select a.stateid1, b.stateid2, a.ssn1,b.ssn2, a.lastname,a.firstname
from tablex a, tabley b
case a.stateid1= b.stateid2