title: SELECTing all ids FROM a MySQL query but with a limitation?
body: <p>I have the following MySQL query:</p>
  
  <pre><code>SELECT SUM(IF(num_content&gt;3,3,num_content)) 
  FROM
  (
  SELECT DATE(FROM_UNIXTIME(content_timestamp)) as dt, COUNT(id) as num_content
  FROM content     
  WHERE author = 'newbtophp'
  GROUP BY DATE(FROM_UNIXTIME(content_timestamp))
  )a
  </code></pre>
  
  <p>Which returns the a count of content (from a specific content author) but with the following restriction => it will only consider a maximum of 3 rows of data per day (using the <code>content_timestamp</code>).</p>
  
  <p>It is working fine, however now I'm wanting to return all ids (do a <code>query</code> then a <code>while loop</code> with <code>mysql_fetch_assoc</code>) which fall under that restriction, I've tried the following query:</p>
  
  <pre><code>SELECT id 
  FROM
  (
  SELECT DATE(FROM_UNIXTIME(content_timestamp)) as dt, COUNT(id) as num_content, id      FROM content     
  WHERE author = 'newbtophp'
  GROUP BY DATE(FROM_UNIXTIME(content_timestamp))
  )a
  </code></pre>
  
  <p>But no luck (as its not returning the ids with the restriction).</p>
  
  <p>The main issue for me is I'm not sure how to integrate the restriction whilst returning the ids.</p>
  
  <p>I appreciate all responses.</p>