I want to search multi vars that could be true in WHERE condition or in HAVING condition in a group_concat table. Something like this:
SELECT
article.id,
article.name,
GROUP_CONCAT(tags.name order by tags.name) AS nameTags,
GROUP_CONCAT(tags.id order by tags.id) AS idTags
FROM
article
LEFT JOIN ....
LEFT JOIN ....
WHERE article.name LIKE '%var1%' OR HAVING nameTags LIKE '%var1%' AND
WHERE article.name LIKE '%var2%' OR HAVING nameTags LIKE '%var2%'
GROUP BY id
Is there some way possible or is it better to do 2 querys?
This query:
SELECT
article.id,
article.name,
GROUP_CONCAT(tags.name order by tags.name) AS nameTags,
GROUP_CONCAT(tags.id order by tags.id) AS idTags
FROM
article
LEFT JOIN ....
LEFT JOIN ....
WHERE
(article.name LIKE '%var1%' OR tags.name LIKE '%var1%') AND
(article.name LIKE '%var2%' OR tags.name LIKE '%var2%')
GROUP BY id
Find what I search, but I must do a second query to show results as I want.
sorry if question is repeated, I didn't know how to ask it, so I did'nt know how to search for it. Sorry my english too!