Welcome Guest, Not a member yet? Register   Sign In
Optimise Model function?
#2

[eluser]Dam1an[/eluser]
Have you tried with a join? Something like...
Code:
SELECT `companies`.`id`, `companies`.`name`, COUNT(`coupons`.`id`) AS `coupon_count`
FROM `companies`
JOIN `coupons` ON `companies`.`id` = `coupons`.`company`
WHERE `featured` = 1


Messages In This Thread
Optimise Model function? - by El Forum - 09-07-2009, 07:10 AM
Optimise Model function? - by El Forum - 09-07-2009, 07:30 AM
Optimise Model function? - by El Forum - 09-07-2009, 08:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB