我有一个包含土耳其国家名称的表格,如“TÜRKİYE”,“TUNUS”等。我有一个查询,可帮助我搜索该表中的国家/地区名称。当我开始用“TÜ”搜索时,它会给我带来“TÜRKİYE”,“TÜRKMENİSTAN”等。但是当我输入“TU”时,它会带来“TUNUS”。
我想要的就是,我输入“TU”,它会为“TÜRKİYE”,“TÜRKMENİSTAN”和“TUNUS”等带来所有结果。我有这个问题,I->İ,O->Ö, S->Ş和所有其他土耳其特定字符。
我的查询:
SELECT "Countries"."countryName",
"Countries"."countryCode",
"Countries"."telephoneCode",
"Countries"."isIbanMantadatory"
FROM "Countries"
WHERE "Countries"."countryName" LIKE :"countryParams" || '%' AND
"Countries"."telephoneCode" LIKE :"telefonParams" || '%'
答案 0 :(得分:0)
我找到了解决这个问题的方法。我希望有帮助:)
SELECT "Countries"."countryName",
"Countries"."countryCode",
"Countries"."telephoneCode",
"Countries"."isIbanMantadatory"
FROM "Countries"
WHERE (Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace("Countries"."countryName", "Ü", "u"), "ü", "u"), "G", "g"), "g", "g"), "S", "s"), "s", "s"), "I", "i"), "İ", "i"), "Ö", "o"), "ö", "o"), "Ç", "c"), "ç", "c")) LIKE (Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(:"countryParams ", "Ü", "u"), "ü", "u"), "G", "g"), "g", "g"), "S", "s"), "s", "s"), "I", "i"), "i", "i"), "Ö", "o"), "ö", "o"), "Ç", "c"), "ç", "c")) || '%' AND (Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace("Countries"."telephoneCode", "Ü", "u"), "ü", "u"), "G", "g"), "g", "g"), "S", "s"), "s", "s"), "I", "i"), "İ", "i"), "Ö", "o"), "ö", "o"), "Ç", "c"), "ç", "c")) LIKE (Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(:"telefonParams ", "Ü", "u"), "ü", "u"), "G", "g"), "g", "g"), "S", "s"), "s", "s"), "I", "i"), "i", "i"), "Ö", "o"), "ö", "o"), "Ç", "c"), "ç", "c")) || '%'