我想返回所有记录(entryID)并且选择了语言标志,我想返回是而不是属性值字段中的实际值。我已经尝试过了,但它返回填充的实际值而不是找到匹配项的 Yes。我认为我需要 where exists 因为这会为与 entryID 关联的每种语言返回太多行。
SELECT distinct x.entryID, ISNOTNULL(a.attributeValue, 'Yes')
from Entry as x
left outer join EntryAttribute as e on e.entryID = x.entryID
left outer join AttributeString as a on a.AttributeID = e.AttributeID
where a.AttributeDefinitionID = 44