[英]what is the best way to call a group of results from mySQL by quarter?
I am looking to order a set of results of a mySQL data by quarter. 我正在按季度订购一组mySQL数据的结果。 They have data fields, so I am wondering if I should be doing this in PHP or in the query itself?
它们具有数据字段,所以我想知道应该在PHP还是在查询本身中执行此操作?
You can use GROUP BY Clause in mysql query and return results as - 您可以在mysql查询中使用GROUP BY子句,并将结果返回为-
group by Quarter(date)
Where Quarter is a pre-defined function in mysql. 其中Quarter是mysql中的预定义函数。
我会在数据库中执行此操作-查找MySQL函数Quarter(Date)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.