如果我正确理解您的问题,您可以这样使用 REPLACE 功能:
SELECT title
FROM video
WHERE REPLACE(REPLACE(title, '-', ' '), '_', ' ') < 'video 03';
这将返回“video 01”、“video-02”、“video_02”等。
编辑:您也可以使用它,将标题的字母数字部分与数字部分分开:
select
title,
first_digit,
left(title, first_digit-1) as alphanumeric_part,
mid(title, first_digit, length(title)-first_digit+1) as digits
from (
select
least(case when locate('0', title)>0 then locate('0', title) else length(title)+1 end,
case when locate('1', title)>0 then locate('1', title) else length(title)+1 end,
case when locate('2', title)>0 then locate('2', title) else length(title)+1 end,
case when locate('3', title)>0 then locate('3', title) else length(title)+1 end,
case when locate('4', title)>0 then locate('4', title) else length(title)+1 end,
case when locate('5', title)>0 then locate('5', title) else length(title)+1 end,
case when locate('6', title)>0 then locate('6', title) else length(title)+1 end,
case when locate('7', title)>0 then locate('7', title) else length(title)+1 end,
case when locate('8', title)>0 then locate('8', title) else length(title)+1 end,
case when locate('9', title)>0 then locate('9', title) else length(title)+1 end) first_digit,
title
from
video
) video_pos
where mid(title, first_digit, length(title)-first_digit+1)+0 < 2
在这里看到它。