I need to perform this query:
SELECT a, COUNT(a) FROM
(SELECT user_id, a FROM database GROUP BY user_id) as users
WHERE a IS NOT NULL
GROUP BY a
Can't find any way to do this kind of subquery in Phalcon. Any help would be much appreciated.
I need to perform this query:
SELECT a, COUNT(a) FROM
(SELECT user_id, a FROM database GROUP BY user_id) as users
WHERE a IS NOT NULL
GROUP BY a
Can't find any way to do this kind of subquery in Phalcon. Any help would be much appreciated.