排除具有数字字符的行,仅在行的开头

Exclude the row which has numeric characters, only at the beginning of the row

我有一个类似的 table 如下:

product      
01 apple
02 orange
banana 10

我试图仅排除以数字开头的行。如果数字不在开头,则不应将其排除在外。所需的 table 输出应如下所示:

product      
banana 10

但是对于我当前的查询,只要行中有数字,它就会排除所有内容:

SELECT * 
FROM table 
WHERE product NOT LIKE '%0%'

有人可以建议我如何解决这个问题吗?非常感谢。

可能是这样的:

SELECT * 
FROM table 
WHERE left(product, 1) NOT IN ('0','1','2','3','4','5','6','7','8','9')

匹配不以数字开头的行的正则表达式是

^[^0-9].*

mysql 中的 sql 查询看起来像

SELECT * 
FROM table 
WHERE product RLIKE '^[^0-9].*'

我会推荐正则表达式。在 Redshift 中,这看起来像:

where product ~ '^[^0-9]'

我可能还建议:

where left(product, 1) not between '0' and '9'