MySQL LIKE Help
I'm currently studying MySQL and came across this problem where I'm having the most trouble solving.
The preceding questions is a lot easier as starting characters like yung need i-check. So I just used multiple LIKE functions to cross out vowels ("A%", "E%","I%","O%","U%",). Now I think I can do the same pero it would be lengthy as I need to manually check each pair (A-A, A-E, so on).
Are there any functions where I can enclose 5 wildcards in one statement instead of using LIKE for each one?
Appreciate if someone can tell me if I'm going towards the right direction, if not maybe you can give me a hint and I'll be glad to research further.
Thank you
UPDATE: I'm done solving all basic questions in HackerRank, got my 4th star today too.
Posted Nov 23, 2022, 4:24 PM UTC · edited
SELECT CITY
FROM STATION
WHERE UPPER(LEFT(CITY,1)) NOT IN ('A','E','I','O','U')
AND UPPER(RIGHT(CITY,1)) NOT IN ('A','E','I','O','U')