 <p>Assuming you want the 10 most recent eve_Dates for each customer.</p> <p><strong>untested</strong> I'm thinking the correlated subquery will generate a result set for each customer, but I'm not positive about that.</p> <p>I don't think you were limiting to the 10 records because you had no join on date.</p> <pre><code>select t1.EVE_DATE, t1.CUSTID, SUM(t1.ATTENDENCE) as PRESENCE, TRUNCATE((AVG(t1.LECTURE_DUR))/(1000),2) as LECTURE_DUR from MY_TABLE t1 left join ( select CUSTID, eve_date from MY_TABLE t2 where t1.EVE_DATE = t2.EVE_DATE order by t2.CUSTID, t2.eve_Date desc limit 10 ) t3 on t1.CUSTID = t3.CUSTID t1.Eve_Date = T3.Eve_Date where t1.SUBJECT= 'PHYSICS' and t1.EVE_DATE &gt;= '2015-01-01' and t1.EVE_DATE &lt;= '2016-01-01' and t1.CUSTID &lt;&gt; '' group by t1.EVE_DATE, t1.CUSTID order by t1.EVE_DATE </code></pre>