Actually SQL is ignoring the where condition in my having clauses. It doesn't matter what I fill in there. It always finds "all" results.
SELECT `status`, count(*) AS count
FROM `wa_re_jo`
WHERE
EXISTS (
SELECT *
FROM `ad_ac_wa`
WHERE `plattform` = 'adwords'
AND `wa_re_jo`.`watchlist_id` = `ad_ac_wa`.`id`
AND EXISTS (
SELECT *
FROM `ad_cu_ac`
WHERE `ad_ac_wa`.`external_id` = `ad_cu_ac`.`externalId`
AND EXISTS (
SELECT *
FROM `ç`
WHERE `ad_cu_ac`.`id` = `ad_cu_ac`.`adwords_customer_account_id`
AND `startDate` <= '2023-04-04'
AND `endDate` + interval 1 DAY >= '2023-04-04'
)
)
)
AND `created_at` LIKE '2023-04-04%'
OR `updated_at` LIKE '2023-04-04%'
GROUP BY `status`
I tried to change the values and the order of the conditions.