Re: Group by YEAR in date
| From: | Marek Kilimajer | Date: | Mon, 28 Oct 2002 13:50:16 +0000 |
| Subject: | Re: Group by YEAR in date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121694@lists.php.net to get a copy of this message | ||
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 ______________________________________