hi, how to conver this statement into yii’s active record format?
SELECT a.USERID, a.ADID, a.PAGEVIEW,a.EXPIRYDATE,a.ADTITLE,a.ADDESC
from CKAD a INNER JOIN
(
SELECT b.USERID, max(b.PAGEVIEW) as PAGEVIEW
FROM CKAD b WHERE b.DISPPUBLISHDATE >= current_date - 3
AND b.EXPIRYDATE >= current_date and b.STATUS = 1 AND b.USERID IS NOT NULL
GROUP BY b.USERID
) b
ON (a.USERID = b.USERID and a.PAGEVIEW = b.PAGEVIEW)
order by a.PAGEVIEW DESC";
You should probably share it then how you do it? Other people might be facing the same problem and it would be better if this post has an answer as well.