In mysql, I would need to select an extra column SELECT SUM(profit), YEAR(apply_date) AS year FROM loan GROUP BY year
Faisal Abdullah wrote:
Hi people,
I have a table (postgres), with a date field (yyyy-mm-dd). How do I group by
year?
'select sum(profit) from loan group by apply_date' would group by the DAY,
not year.
Thanks.
Regards,
Faisal
______________________________________
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php