I'm building a query where I search for results within the concatenation and got enough to ask for help. I currently use MySQL with the PHP application.
In the example below, I look for the words "F1000" and "GRID" in a concatenation of columns of both tables. The product may or may not have a grid.
SELECT p.id,
p.id_maker,
p.name,
p.description,
p.specifications
FROM product AS p
WHERE CONCAT(
CONCAT_WS(
' ',
p.name,
p.description,
p.specifications
), ', ',
GROUP_CONCAT(
(
SELECT CONCAT_WS(
' ',
g.description,
g.original_cod_maker
)
FROM product_grid AS g
WHERE g.fk_son = p.id
)
SEPARATOR ', ')
)
REGEXP '(.*)GRID(.*)F1000(.*)'
This query presents an error 1111 (invalid use of group function) regarding the use of concatenation methods.
Thank you in advance for your help.