I am beginner in using codeigniter query builder class. and I got a problem in converting this query using query builder class.
SELECT tb_country.`countryName`, COUNT(tb_country.countryId) AS totalCustomer FROM tb_customer
JOIN tb_city ON tb_city.`cityId` = tb_customer.`cityId`
JOIN tb_state ON tb_state.`stateId` = tb_city.`stateId`
JOIN tb_country ON tb_country.`countryId` = tb_state.`countryId`
GROUP BY tb_country.`countryName`
any answers will be helpful to me, thanks in advance!