我如何排序mySQL正则表达式顺序

时间:2018-03-22 20:43:42

标签: mysql sql sql-order-by

ID test_varc

0 = "40:11,80:31",
1 = "40:12,80:32",
2 = "40:13,80:33",
3 = "40:14,80:34",
4 = "91:21,40:35",
5 = "91:22,40:36",
6 = "91:23,40:37",
7 = "40:15,91:24",
8 = "40:16,91:25",
9 = "40:17,91:26"

Output
ID test_varc

0 = "40:11,80:31",
1 = "40:12,80:32",
2 = "40:13,80:33",
3 = "40:14,80:34",
7 = "91:21,40:15",
8 = "91:22,40:16",
9 = "91:23,40:17",
4 = "40:35,91:24",
5 = "40:36,91:25",
6 = "40:37,91:26"

select id, test_varc from test_table order by test_varc REGEXP '(40:\d+,)' desc

regexp的mysql命令不起作用。我该怎么做?感谢

0 个答案:

没有答案
相关问题