Morning, I'm having trouble understand the best way to join the following two queries together.
The first code shows me the last entry by name and I'd like a count of each time the name is listed. In the second query it correctly counts the names but I can not seem to work out how to add the count into the same result.
Thanks in Advance
SELECT `TimeStamp` as TimeStamp,`Name`, `Status` ,`Station`,`Role`,`Line`
FROM trs_contact u1
WHERE u1.`TimeStamp` = (SELECT MAX(`TimeStamp`)
FROM trs_contact u2
WHERE u1.`Name` = u2.`Name`
)
SELECT `Name`, COUNT(*)
FROM `trs_contact`
GROUP BY `Name`