select c.campaign_id,c.campaign_name,
(SELECT count(campaign_id) from campaign_activity WHERE campaign_id=c.id AND is_clicked=1) as numberofclicks,
(SELECT count(campaign_id) from campaign_activity WHERE campaign_id=c.id AND is_clicked=1) as numberofopens
FROM
campaign c
WHERE c.flag=1

But people state that using sub-queries are a bad coding convention and make use of join rather than sub-queries. But i'm not sure ways to get exactly the same result using join. I consulted with a few of my co-workers and they're stating that it is not easy to use participate in this case. Can you really obtain the same result using joins? if so, please let me know how.

Observe that by having an INNER JOIN here, you will not see campaigns where there is nothing corresponding within the campaign_activity table. For the reason that circumstance, you need to use a LEFT JOIN, and convert NULL to within the SUM, e.g. SUM(IFNULL(is_clicked on, )).