I just need an help on making an query work.
I wanted To get the records for an all users whose total cdr seconds is >= 2400 (40 minutes)
SELECT SUM(TIME_TO_SEC(cdr.duration)) AS secsUsed
FROM cdr
WHERE SUM(TIME_TO_SEC(cdr.duration))>=2400
GROUP BY ownerpin
ORDER BY secsUsed DESC
i found that aggregate function usage like above will not work!
is there any way that i could get the logic work !!