I'm having a problem converting below MySQL code to a Codeigniter active record query.
SELECT sss.*, c.country_name, c.country_code
FROM ( SELECT gr.*
FROM (`be_goldrate` as `gr`)
WHERE `gr`.`country_id` != 0
AND `gr`.`rate_type` = 'calculated'
ORDER BY gr.date DESC ) as sss
LEFT JOIN `be_countries` as `c`
ON `c`.`country_id`=`sss`.`country_id`
GROUP BY `sss`.`country_id`
I've tried as suggested here but without success.
be_goldrateasgr) WHEREgr.country_id!= 0 ANDgr.rate_type= 'calculated' ORDER BY gr.date DESC ) ? to increase performance? - Joel Harkes