Hey guys ,thought this would be an easy one but am puzzled ( Maybe im just tired!) I get updates from the web into mysql db something like Rownum, Status , Name,StudentNumber,date 1,Good,Tom,12345,20/01/09 2,Bad,James,14456,20/01/09 3,Bad,Tom,12345,21/01/09 4,Good,Mary,44566,22/01/09 etc When I do the select I want to see all the records .. but only one per Student Number and only the lastest entry..(ive seen "select * from table order by rownumber desc limit 1" but only shows me one record... p.s. The data above is only an example.. but you get my meaning Really apreciate it! Tom
SELECT Rownum, Status, Name, StudentNumber, Date FROM mytable WHERE CONCAT(StudentNumber,date) IN (SELECT CONCAT (StudentNumber,MAX(date)) FROM mytable GROUP BY user) ORDER by Rownum; This should do the trick