I am trying to run this view.
select `AM`.`athleteID` AS `athleteid`,
`AM`.`maxLift` AS `maxlift`,
`AM`.`dateofmax` AS `dateofmax`,
`TP`.`date` AS `date`,
`TP`.`teamID` AS `teamID`,
`TSP`.`trainingSessionProgramID` AS `trainingSessionProgramID`,
`TSP`.`trainingSessionKey` AS `trainingSessionKey`,
`E`.`exerciseName` AS `exerciseName`,
`RS`.`repScheme` AS `repScheme`,
`RS`.`percentage` AS `percentage`,
`TSP`.`exerciseID` AS `exerciseID`,
`TSP`.`repSchemeID` AS `repSchemeID`
from ((((`dutchIron`.`tblExercises` `E`
left join `dutchIron`.`tblTrainingSessionProgramming` `TSP`
on((`E`.`exerciseID` = `TSP`.`exerciseID`)))
left join `dutchIron`.`tblRepSchemes` `RS`
on((`RS`.`repSchemeID` = `TSP`.`repSchemeID`)))
left join `dutchIron`.`tblProgramming` `TP`
on((`TP`.`trainingSessionKey` = `TSP`.`trainingSessionKey`)))
left join `dutchIron`.`tblAthleteMaxs` `AM`
on((`AM`.`exerciseID` = `E`.`exerciseID`)))
I am recording a max lift weight in tblAthleteMaxs
. However, when I run the query a get multiple sets of rows depending on how many max weight values (AM.maxLift
) I have in the table. Ideally, I just want to select the most recent max weight value (AM.dateofmax
) and have the view return just those rows. Can anyone help? Many thanks in advance.
Here is what is returned currently. Ideally I just want the ones with 500 as maxlift based on the fact that it is a later date. Right now it includes all of the 345 rows as well.
I've review the repeat post, but none of it makes sense to me. I just need all the rows that have the latest dateofmax. Doing a max(dateofmax) doesn't work because it just pulls one record. Any assistance would be appreciated.