SQL – After group by filtering down to rows where column value = certain string

Advertisements Not sure why this isn’t working. When I run the query without HAVING segment ilike ‘Enterprise’ I get results (see screenshot) but when I add it back in the query returns nothing despite clearly containing instances where segment = ‘Enterprise’. I can’t find any instances online where having is used to filter for strings… Read More SQL – After group by filtering down to rows where column value = certain string

MySQL | Trouble Combining JOIN, GROUP BY, and HAVING SUM

Advertisements I’m trying to aggregate data from two tables and having trouble displaying it correctly. I searched for an answer to my question on stackoverflow, MySQL documentation, and several tutorials with no luck. Anyway, here’s what I got. SELECT works_with.client_id AS ‘Client ID’, client.client_name AS ‘Client Name’, works_with.total_sales AS ‘Total Sales’ FROM works_with JOIN client… Read More MySQL | Trouble Combining JOIN, GROUP BY, and HAVING SUM

Is there possible to remove 1 records or max(id) from GROUP_CONCAT MYSQL

Advertisements I have to remove/skip the 1st records or max id in group_concat MYSQL. Here is query select email, group_concat(id order by id desc) as id from api_admin.external_user group by email having count(1) > 1; >Solution : Your GROUP_CONCAT() returns a string which is a comma separated list of at least 2 ids (because of… Read More Is there possible to remove 1 records or max(id) from GROUP_CONCAT MYSQL