I'm trying to do something like this...
SELECT lc.Location, count(h.empID) as 'Count', lu.LBL
FROM swam.lookup lu
LEFT JOIN swam.empTable h
WHEN lu.sac is null
THEN lu.POS = h.POS
lu.POS = h.POS
lu.sac = h.sac)
INNER JOIN swam.Locations lc
ON h.LocationID = lc.LocationID
GROUP BY lc.Location, lu.LBL
ORDER BY lc.Location
case. Just use direct boolean logic:
FROM swam.lookup lu LEFT JOIN swam.empTable h ON lu.POS = h.POS AND (lu.sac is null OR lu.sac = h.sac) INNER JOIN swam.Locations fs ON h.LocationID = lc.LocationID
As a bonus, the database engine can also table advantage of an index on
pos in either (or both) tables.