title: MySQL get start and end date of a quarter by quarter number
body: <pre><code>$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)";
  </code></pre>
  
  <p>Given only current years rows count, because grouping by quarter, I need to group by <code>(quarter,year)</code>, how can I do that?</p>