I have this MySQL query that can get the maximum value from all rows in my table, it's working though but the problem is how can I get the other columns from the row that has the maximum value?
The record_id
that shows in the result is from the first row not from the row that has the maximum value.
Query:
SELECT `record_id`, MAX(download_count) as `max_dl` FROM `downloads`
Result:
+-----------+--------+
| record_id | max_dl |
+-----------+--------+
| 13 | 5 |
+-----------+--------+