1
I have a table with the following records:
+----+------------+--------------+
| id | title | url |
+----+------------+--------------+
| 1 | Olá Mundo! | ola-mundo-1 |
| 5 | Olá Mundo! | ola-mundo-3 |
| 6 | Olá Mundo! | ola-mundo-10 |
| 7 | Olá Mundo! | ola-mundo-2 |
| 8 | Olá Mundo! | ola-mundo-15 |
+----+------------+--------------+
I need to sort by the column url
considering the number that exists at the end.
+----+------------+--------------+
| id | title | url |
+----+------------+--------------+
| 1 | Olá Mundo! | ola-mundo-1 |
| 7 | Olá Mundo! | ola-mundo-2 |
| 5 | Olá Mundo! | ola-mundo-3 |
| 6 | Olá Mundo! | ola-mundo-10 |
| 8 | Olá Mundo! | ola-mundo-15 |
+----+------------+--------------+
Note that this sorting of strings with functions does not use indices. So the best case would be to separate the information as Bacco suggested.
– jlHertel
@jlHertel will incorporate the remark in the text of the question.
– Bacco