select a.code, b.translationName
from Funds a
inner join Translations b ON a.code = b.code
where a.code= 'xyz123'
该查询返回两列,两列如下结果:T-SQL转换内部连接表中的行为
code translationName
---------------------------------------
xyz123 'Fund's chineseName'
xyz123 'Fund's JapaneseName'
有没有办法返回结果为
code translatonName1 translationName2
xyz123 'Fund's chineseName' 'Fund's JapaneseName'
顺便说一句,有一列languageId
在Translations
表。
你的代码适合我,你确定这两个代码是一样的吗?也许试试LTRIM(RTRIM(a.code))= LTRIM(RTRIM(b.code)) –
您还需要在select语句中指定两个translationName字段,而不仅仅是其中的一个。 –
那么你的查询工作,然后,如果它显示在2行,那么代码必须以某种方式不同。 –