Max and group by query help We have query as below. What we need is to select particular training with latest date and only single data but now when we run the query below we get more then one results.

SELECT tblTraining.clientTrainingID AS lastID, MAX( tblTraining.trainingDate ) AS lastDate
FROM tblTraining
WHERE tblTraining.trainedID =37
GROUP BY tblTraining.clientTrainingID
Try 

SELECT 
  tblTraining.clientTrainingID AS lastID,
  MAX( tblTraining.trainingDate ) AS lastDate
 FROM tblTraining
 WHERE tblTraining.trainedID =37
 GROUP BY tblTraining.clientTrainingID
 ORDER BY tblTraining.clientTrainingID desc
 LIMIT 1 


This will order the max() and limit the result to the first line being the highest value.