简体   繁体   中英

SELECT WHERE LIKE returns incomplete results and the reason is not diacritics

I am searching for results WHERE name LIKE '%Soucek%' (or I tried '%Souček%' or '%Soućek%' . I get one result. (I set the whole column to be COLLATE SQL_Latin1_General_CP1251_CI_AS ). If I search for '%Sou_ek%' i get all results there are. I dont understand what is going on. Do you have an idea?

Consider using AI : "Accent Insensitive" instead of AS : "Accent Sensitive".

Also, make sure that both sides have the same collation to avoid errors or further coercions:

WHERE name COLLATE Latin1_General_CI_AI Like '%Soucek%' COLLATE Latin1_General_CI_AI

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM