按日期对一组数据进行分组

The question is a little on the noobish end as I'm just starting to mess with PHP. However my project is to create a basic statistics page. So let me go ahead and explain exactly what I'm looking for (in it's most basic form).

Basically I have an table with the following structure. [ TransactionID, Date, Amount ]
What I want to do is group everything by a certain date and display all of the transactions that happened on that date, so I believe the query would look something like this.

Select * from table where date = 2014-05-24

Alright, that's all fine and dandy and I can easily get the sum like that, but How would I get the transactions for a certain month, or year even?

This is a personal project and won't be used at all on a professional scale, but it's something that I'm working on as a hobby.

查看全部
dqc18251
dqc18251
2014/05/25 10:21
  • php
  • mysql
  • sql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复