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
Microsoft SQL Server
8/22/2022 - Mon
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!