I want to query the list of CITY names from the table STATION(id, city, longitude, latitude) which have vowels as both their first and last charact
Both of the statements below work in Microsoft SQL SERVER
SELECT DISTINCT
city
FROM
station
WHERE
SUBSTRING(lower(CITY), 1, 1) IN ('a', 'e', 'i', 'o', 'u')
AND SUBSTRING(lower(CITY), LEN(CITY), 1) IN ('a', 'e', 'i', 'o', 'u');
SELECT DISTINCT
City
FROM
Station
WHERE
City LIKE '[A, E, O, U, I]%[A, E, O, U, I]'
ORDER BY
City;