为什么此代码不起作用“从像“ [aeiou]%”这样的城市中的城市中选择不同的城市”

时间:2019-07-09 13:17:12

标签: mysql

enter image description here

我尝试过:

SELECT DISTINCT CITY 
FROM STATION 
WHERE CITY LIKE '[aeiou]%';

1 个答案:

答案 0 :(得分:1)

SELECT DISTINCT CITY 
FROM STATION 
WHERE CITY REGEXP '^[aeiou]';

答案来自: find all the name using mysql query which start with the letter 'a'

有关REGEXP的文档: https://dev.mysql.com/doc/refman/8.0/en/regexp.html