M
M
Manager12019-01-11 01:27:54
SQL
Manager1, 2019-01-11 01:27:54

How can I solve the problem with the encoding in the request?

Good afternoon. Have a request

SELECT COUNT(DISTINCT `article`) FROM table1 WHERE size LIKE 'Р%'

The problem is that the data in the size field is in this form
["\u042f\u0440\u043e\u0441\u043b\u0430\u0432\u0441\u043a\u0430\u044f \u043e\u0431\u043b\u0430\u0441\"]

Because of this, the condition does not work.
Tried to assign characters in the same form
SELECT COUNT(DISTINCT `article`) FROM table1 WHERE size LIKE '\u042f%'
, but unfortunately only works with one character. If I add another one, it returns 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2019-01-11
@Manager1

for good, of course, it is worth transcoding to normal text.
but you can search this way, you just need to escape the slashes -LIKE '\\\\u042f\\\\u0440%'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question