N
N
Nubbin2017-08-11 06:17:46
WPF
Nubbin, 2017-08-11 06:17:46

Disable letter case?

Good evening, guys, how can I turn off the case of letters, it's just that it really interferes in the search
SELECT * FROM table WHERE NAME LIKE '%Текст%'
if there are "test", "test", "TEST", "Test" in the database, it does not find them.
How can this problem be solved?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2017-08-11
@BuriK666

MySQL: https://stackoverflow.com/questions/18853452/sql-s...
Postgresql: https://www.postgresql.org/docs/current/static/fun...

A
akzhan, 2017-08-11
@akzhan

depending on the dialect

SELECT * FROM table WHERE name ILIKE '%Текст%'; -- надежнее всего

SELECT * FROM table WHERE LOWER(name) LIKE LOWER('%Текст%'); -- тут правильнее casefolding, но увы

or set the desired case insensitive collation (there are many options).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question