0

In Postqresql, I have this query:

select *  
from students 
where name like '%Huseyin%'

When I run it, I want to get data that has name is "Huseyin", "Hüseyin", "Huseyın", "Hüseyin".

How can I do this? I use Dapper. I did not create database with collation. I just want to use collation in select query (Turkish special characters is i,ü,ş,ö,ğ)

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
AnilKilic
  • 9
  • 2
  • try this post and see if you can get it working. https://stackoverflow.com/questions/11005036/does-postgresql-support-accent-insensitive-collations – Charles Han Nov 24 '22 at 21:05
  • PostGreSQL as very poor collations features compare to Microsoft SQL Server. Perhaps you can try to add ICU collations, buts it's bugged with the LIKE operator... – SQLpro Nov 25 '22 at 13:23

2 Answers2

0

We solved this question like this;

SELECT * FROM student WHERE unaccent(first_name) ilike unaccent('%caglar%')

it brings data if caglar or çağlar exist in database. Before use "unaccent", it is necessary some setting in postgresql database.

AnilKilic
  • 9
  • 2
-1

Add this query and try again.

Select * From [TableName] Where [ColumnName] Like ‘%Ayşe%’ COLLATE SQL_Latin1_General_CP1_CI_AS

Murad
  • 52
  • 5