前言
HackerRank中Basic Select专题Weather Observation Station 6

意思是查询首字母是元音(a,e,i,o,u)的city 数据;本文从 REGEXP、like、substring来编写查询语句
一、REGEXP\like\substring
1、使用正则表达式REGEXP
select CITY from station where CITY REGEXP '^[aeiouAEIOU]'
2、使用like
select CITY from station where CITY like 'a%' or city like 'e%' or city like 'o%' or city like 'i%' or city like 'u%'
3、使用substring
select CITY from station where substring(city,1,1) in ('a','e','i','o','u')
本文介绍了如何在HackerRankBasicSelect专题中的WeatherObservationStation6任务中,使用REGEXP、like和substring关键字进行查询,以找出首字母是元音的city数据。
1602

被折叠的 条评论
为什么被折叠?



