help to display the data, here's the query I'm using

SELECT g.`name_ru-RU` as nameship,
      (SELECT COUNT (c.id)
         FROM `crm` c
         WHERE c.`dostavka` LIKE '% g.`name_ru-RU`%'
      ) as totalcrm
  FROM shipping g

the error occurs in this place

LIKE '% g.`name_ru-RU`%')

if I remove g.`name_ru-RU and insert the text, then everything is fine, but I need him to search for this column

like concat ('%', g.name_ru-RU, '%')

splash582022-01-11 08:21:05

thanks, forgot about him altogether)

GENESIS2022-01-11 08:26:02

Better WHERE LOCATE (g.name_ru-RU, c.dostavka) or WHERE INSTR (c.dostavka, g.name_ru-RU). Why an extra function call?

Akina2022-01-11 08:27:23