[eluser]Unknown[/eluser]
I am trying to convert the following SQL query to Active Record. Can anyone help me at all?
SELECT a.*
FROM banners a
INNER JOIN
(
SELECT MIN(impression_count) AS impression_count
FROM banners
GROUP BY location
) b ON a.impression_count = b.impression_count
GROUP BY a.location
Thanks!