Как посчитать общее кол-во данных после группировки?
SELECT COUNT(i.name) as count
FROM cms_base i
LEFT JOIN cms_join as c ON i.id = c.id_join
LEFT JOIN cms_images as m ON i.id = m.id
WHERE (CONCAT_WS(",", i.test," ", i.test1," ", i.test2," ", i.tes3) LIKE '%test%')
GROUP BY i.name
limit 0,20
Результат:
Как в COUNТ получить общее число, в данном случае 19?
SELECT COUNT(DISTINCT(i.name)) as count
FROM cms_base i
LEFT JOIN cms_join as c ON i.id = c.id_join
LEFT JOIN cms_images as m ON i.id = m.id
WHERE (CONCAT_WS(",", i.test," ", i.test1," ", i.test2," ", i.tes3) LIKE '%test%')
limit 0,20