2016-11-11 55 views
0

我有一个表,我有一个翻译领域。该表具有countryID,具体取决于我们可以针对不同的语言获取某些英文单词的翻译文本。现在我想将英语单词与另一个语言单词相比较。翻译文本是否有其他空格或特殊字符。如何比较一些列与它自己取决于组的结果?

Image One : Table Structure

Image Two : Different translation for the same word

+0

请仔细阅读[这](http://meta.stackoverflow.com/a/285557/ 243373)关于为表格结构发布图像问题为什么不好。 –

+0

需要紧急帮助..图像供可以理解的人参考。 –

回答

0

这样做的一种方式是这样的:

select 
    t1.fieldName, 
    t1.translatedText, 
    t2.translatedText 
    case 
    when t1.translatedText = t2.translatedText then 'equal' 
    else 'not equal' 
    end isEqual 
from myTable t1,myTable t2 
where t1.CultureName = 'en-US' 
and t2.CultureName = 'ru-RU' 
and t1.fieldName = t2.fieldName