开发者

MySQL get start and end date of a quarter by quarter number

$sq ="
SELECT count(noofrows),QUARTER(Date(last_call)) as quarter,YEAR(last_call) 
FROM $dbt.travel_crm 
WHERE Date(last_call) BETWEEN '".$_GET['startdate']."' 
AND '".$_GET['enddate']."' 
GROUP BY QUARTER(Date(last_call)) 
ORDER BY YEAR(last_call)";

Given only current years rows count, because grouping by quarter, I need to group by (quarter,year), how can I do开发者_开发百科 that?


If you need to group by quarter and year - just do so:

GROUP BY YEAR(last_call), QUARTER(last_call)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜