MySQL LIKE Help

discussion

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.

https://preview.redd.it/860nkbvu8q1a1.png?width=766&format=png&auto=webp&s=3fd5b713b3b89af52ae0e9836f12ee758eeadd6c

Posted Nov 23, 2022, 4:24 PM UTC · edited

13
beklog•

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')

6
charliegumptu•

left(col,1) in ('a', 'e', ...)

1
mrloogz•

sana magka thread sa mga nagtatanong ng mga ganito para mapractice din tayo hahahah

1