0

I have a table like this:

LessonID    Lesson
127         زیست‌شناسی
128         زیست‌شناسی 1
129         زیست‌شناسی 2
130         زیست‌شناسی 3
.           .
.           .

When I run this select:

select * from tblLesson where Lesson like '%زیست%'

there is no result retured.

What's wrong with this?

Stephan Bauer
  • 9,120
  • 5
  • 36
  • 58
  • 11
    Have you tried `N'%زیست%'`? To see the difference run `SELECT 'زیست', N'زیست'`. – HoneyBadger Nov 10 '21 at 12:36
  • 3
    Does this answer your question? [What is the meaning of the prefix N in T-SQL statements and when should I use it?](https://stackoverflow.com/questions/10025032/what-is-the-meaning-of-the-prefix-n-in-t-sql-statements-and-when-should-i-use-it) – Thom A Nov 10 '21 at 12:40

1 Answers1

0

The data stored in the table depends on the collation, as well as the type of column, especially if the type is VARCHAR, especially for some letters of Persian and Arabic languages.

personally, for Persian language, in older versions of sql-server, i prefer the "SQL_Latin1_General_CP1256_CI _..." collation.

the character 'ی' is used in this word 'زیست'

the character 'ي' is used in this word 'زیست'

in stand alone letter, you see difference but when it used in a word, visually it isn't appear

for a temporary solution without review,you must try something like this :

select * from tblLesson where Replace(Lesson,'ي','ی') like '%زیست%'

for clear view of characters see the picture : clear view of characters

Ali Pouyan
  • 16
  • 1
  • 3