I have small mysql table with:
id
name
status
class
desk
date
username
It has around 300 records.
When selecting data to get the latest record by date
(formatted), along with username
, I use this statement:
SELECT DATE_FORMAT(MAX(date), '%d-%m-%Y at %H:%i'), username as LatestRecord from myTable
It returns the correct record for dateTime but gives different username
which is not in the same selected row. It seems like it doesn't select the username
for the same resulted lastest date/time.
Any idea why this happens?