select count(id) cnt from segments_emails where project_id = 10
select m.newsletter_id, count(m.id) cnt
from flow f, message m
where f.id = m.newsletter_id
group by m.newsletter_id
select count(m.id) cnt
from message m
where m.newsletter_id= your_newsletter_id
select f.project_id, count(m.id) cnt
from flow f, message m
where f.project_id = m.project_id
group by f.project_id
select count(m.id) cnt
from message m
where m.project_id = your_project_id
select min(json_extract(JSON_Col, CONCAT('$.Strength[', idx, ']'))) min_St
,max(json_extract(JSON_Col, CONCAT('$.Strength[', idx, ']'))) max_St
from tables
JOIN (
SELECT 0 AS idx UNION
SELECT 1 AS idx UNION
SELECT 2 AS idx UNION
SELECT 3 AS idx UNION
SELECT 4 AS idx UNION
SELECT 5 AS idx
) AS indexes
WHERE JSON_EXTRACT(JSON_Col, CONCAT('$.Strength[', idx, ']')) IS NOT NULL