How can I select the last records (= MAX (order_history_id) from this table (one [last] row on order_id):
+----------------+--------+-------+----------+
|order_history_id|order_id|trackc |date_added|
+----------------+--------+-------+----------+
| 4400 | 1000 | text | 2014-9-24|
| 4401 | 1001 | text2 | 2014-9-26|
| 4410 | 1000 | text3 | 2014-9-29|
| 4411 | 1003 | text4 | 2014-9-20|
+----------------+--------+-------+----------+
My current request:
SELECT * FROM order_history WHERE trackc <> '' GROUP BY order_id
source
share