开发者

sql: compare 2 strings without considering accents and other stuff îăţş = iats (<-should be equal)

开发者 https://www.devze.com 2023-01-07 15:22 出处:网络
I need to compare 2 strings in sql so that the word开发者_运维问答 \"iast\" would be equal to \"îăşţ\"

I need to compare 2 strings in sql so that the word开发者_运维问答

"iast" would be equal to "îăşţ"

anybody knows how to do this ?


Just use an accent-insensitive collation for your comparisons:

IF 'iast'='îăşţ' COLLATE Latin1_General_CI_AI
PRINT 'YES'

For more info go through this link


  select 1 from Table_1
  where 'iast' = 'îăşţ' COLLATE Latin1_General_CI_AI
0

精彩评论

暂无评论...
验证码 换一张
取 消