Как я могу получить самую последнюю дату, используя MySQL?Я пытался Макс, но я не получил результат, который я хочу.Моя таблица выглядит следующим образом:
+---------+---------+-----------------------+--------+------------+---------+
| Name | idStore | Name | idItem | date | price |
+---------+---------+-----------------------+--------+------------+---------+
| walmart | 1 | Red Delicious Apples | 1 | 2011-10-22 | 0.98000 |
| walmart | 1 | Red Delicious Apples | 1 | 2011-10-28 | 0.98000 |
| walmart | 1 | Red Delicious Apples | 1 | 2011-10-28 | 0.98000 |
| walmart | 1 | Red Delicious Apples | 1 | 2011-11-22 | 0.98000 |
| walmart | 1 | Honeycrisp Apples | 2 | 2011-10-22 | 1.98000 |
| walmart | 1 | Sonya Apples | 3 | 2011-10-22 | 2.88000 |
| walmart | 1 | Gold Delicious Apples | 4 | 2011-10-22 | 0.98000 |
| walmart | 1 | Sweet Tango Apples | 5 | 2011-10-22 | 2.48000 |
| walmart | 1 | Granny Smith Apples | 6 | 2011-10-22 | 1.28000 |
| walmart | 1 | Fugi Apples | 7 | 2011-10-22 | 1.38000 |
+---------+---------+-----------------------+--------+------------+---------+
Я хочу получить эту таблицу:
+---------+---------+-----------------------+--------+------------+---------+
| Name | idStore | Name | idItem | date | price |
+---------+---------+-----------------------+--------+------------+---------+
| walmart | 1 | Red Delicious Apples | 1 | 2011-11-22 | 0.98000 |
| walmart | 1 | Honeycrisp Apples | 2 | 2011-10-22 | 1.98000 |
| walmart | 1 | Sonya Apples | 3 | 2011-10-22 | 2.88000 |
| walmart | 1 | Gold Delicious Apples | 4 | 2011-10-22 | 0.98000 |
| walmart | 1 | Sweet Tango Apples | 5 | 2011-10-22 | 2.48000 |
| walmart | 1 | Granny Smith Apples | 6 | 2011-10-22 | 1.28000 |
| walmart | 1 | Fugi Apples | 7 | 2011-10-22 | 1.38000 |
+---------+---------+-----------------------+--------+------------+---------+
Мне трудно понять это.Спасибо!