How to retrieve row data by MAX(date)?
There is a table:
+---------+--------+---------------------+----------+
| user_id | marker | date | trans_id |
+---------+--------+---------------------+----------+
| 6 | M | 2013-08-27 11:45:24 | 5 |
| 6 | MA | 2013-08-27 11:45:42 | 6 |
| 6 | A | 2013-08-27 11:45:59 | 7 |
+---------+--------+---------------------+----------+
I tested query:
SELECT marker , MAX(date) AS maxdate FROM mytable WHERE user_id =6
but it isn't proper. How you would write query? Thanks in advance.
No comments:
Post a Comment