I have a SQL DB that contains multiple relational tables. There are some fields in the master table that reference another table multiple times. For example, say I have a data
You need to use table aliases in order to join multiple copies of the same table:
SELECT m.Name,
s1.Enumeration AS 'State1',
s2.Enumeration AS 'State2'
FROM MasterTable m
LEFT JOIN StateTable s1 = s1.id = m.state1
LEFT JOIN StateTable s2 = s1.id = m.state2
An INNER JOIN requires that data is present - if not, the entire record is excluded. A LEFT JOIN is safer, like if the state1/2/3/etc allows NULLs...