We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28840
    • 46 Posts
    Hi folks... i’m killing myself trying to translate a mysql query to xpdo...

    SELECT User.id,User.username, ifnull(Profiles.dids,0) as p_count
    FROM `modx_users` AS `User`
    LEFT JOIN
    (SELECT uid, count(*) as dids
    FROM `modx_special_user_profiles`
    GROUP BY uid)
    `Profiles` ON User.id = Profiles.uid

    I’m having problem of subquery inside of LEFT JOIN and only way i found to resolve it is to use xPDOCriteria which "sucks" becouse there is no "$c->select()" or "$c->sortby()" or "$c->limit()" on parent query which i realy need for dynamic changing smiley

    Hope someone can help me with this one smiley

    Sumoborac