I'm trying to sort by a certain character on a string, for example,
before:
+----+---------+
| id | name |
+----+---------+
| 1 | red |
| 2 | red-a |
| 3 | red-xy |
| 4 | blue |
| 5 | blue-a |
| 6 | blue-xy |
+----+---------+
after:
+----+---------+
| id | name |
+----+---------+
| 4 | blue |
| 1 | red |
| 5 | blue-a |
| 2 | red-a |
| 6 | blue-xy |
| 3 | red-xy |
+----+---------+
are there any ways to categorize based on -a or -xy using ORDER BY
Thank you in advance.