select manga_source_id, manga_episode_name, manga_episode_number
from manga_chapter
+-----------------+--------------------------------------+----------------------+
| manga_source_id | manga_episode_name | manga_episode_number |
+-----------------+--------------------------------------+----------------------+
| 5 | A Method to Make the World Gentle 1 | 1 |
| 5 | A Method to Make the World Gentle 2 | 2 |
| 5 | A Method to Make the World Gentle 3 | 3 |
| 5 | A Method to Make the World Gentle 5 | 5 |
| 5 | A Method to Make the World Gentle 6 | 6 |
| 5 | A Method to Make the World Gentle 7 | 7 |
| 5 | A Method to Make the World Gentle 8 | 8 |
| 5 | A Method to Make the World Gentle 9 | 9 |
| 5 | A Method to Make the World Gentle 10 | 10 |
| 5 | A Method to Make the World Gentle 11 | 11 |
| 5 | A Method to Make the World Gentle 12 | 12 |
| 5 | A Method to Make the World Gentle 13 | 13 |
| 5 | A Method to Make the World Gentle 14 | 14 |
| 5 | A Method to Make the World Gentle 15 | 15 |
| 5 | A Method to Make the World Gentle 16 | 16 |
| 5 | A Method to Make the World Gentle 17 | 17 |
| 5 | A Method to Make the World Gentle 18 | 18 |
| 5 | A Method to Make the World Gentle 19 | 19 |
| 5 | A Method to Make the World Gentle 20 | 20 |
| 5 | A Method to Make the World Gentle 21 | 21 |
| 5 | A Method to Make the World Gentle 22 | 22 |
| 5 | A Method to Make the World Gentle 23 | 23 |
| 5 | A Method to Make the World Gentle 24 | 24 |
| 5 | A Method to Make the World Gentle 25 | 25 |
| 5 | A Method to Make the World Gentle 26 | 26 |
+-----------------+--------------------------------------+----------------------+
25 rows in set (0.00 sec)
select manga_source_id, manga_episode_name, manga_episode_number
from manga_chapter
GROUP by manga_source_id
ORDER BY manga_episode_number DESC
+-----------------+-------------------------------------+----------------------+
| manga_source_id | manga_episode_name | manga_episode_number |
+-----------------+-------------------------------------+----------------------+
| 5 | A Method to Make the World Gentle 1 | 1 |
+-----------------+-------------------------------------+----------------------+
Я пытался получить последний manga_episode_number, который Метод, чтобы сделать мир нежный 26 однако он не работает, я даже указать ORDER по manga_episode_number DESCMYSQL Заказывайте после GROUP BY не работает
Как достичь чертежа последней записи, с GROUP от
спасибо!
Вам не нужно группу по 'выберите manga_source_id, manga_episode_name, manga_episode_number от manga_chapter ORDER BY manga_episode_number DESC LIMIT 1;' –
@JorgeCampos мне нужна группа по потому, что у меня будет еще один ряд записей с отличием rent manga_source_id, я просто хочу сделать 1 запись каждого manga_source_id с самым высоким manga_episode_number –
Вам нужно имя? 'manga_episode_name'? –