我与Sandql一起做了活动,在数据库中添加以下领域的活动:id、所有权、内容、日期(时间: YYYY-MM-DD 00:00:00)
我想按年/月分类我的记录,并计算结果。
www.un.org/Depts/DGACM/index_french.htm
- Event1 title1 content1 date1
- Event2 title2 content2 date2
- Event2 title2 content2 date2
<DECEMBER 2011: 2 results
- Event1 title1 content1 date1
- Event2 title2 content2 date2
......
I try differents ways using group by but nothing conclusive I appreciate your time and i wait for feedback. Thanks in advance.
我尝试了这部法律。
SELECT id, title, content, date, EXTRACT( YEAR
FROM date ) ANNEE, EXTRACT(
MONTH FROM date ) MOIS, COUNT(*) AS mySum
FROM plaquerecherchee
GROUP BY ANNEE, MOIS
ORDER BY ANNEE, MOIS
仅有一个月结果.........