We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You can use negative indexing in Oracle.
select distinct city from station where upper(substr(city,-1)) in ('A','E','I','O','U');
Lot of comments about Lower and upper, so here is the explanation, in any kind of programming it is better to convert the string you are comparing to uppercase or lowercase.
So if user enters "bangalore", "Bangalore", "bAnGlore", "BANGALORE", everything still resolves to "BANGALORE" in my query and hence works. String comparision is case sensitive.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 7
You are viewing a single comment's thread. Return to all comments →
You can use negative indexing in Oracle. select distinct city from station where upper(substr(city,-1)) in ('A','E','I','O','U');
Lot of comments about Lower and upper, so here is the explanation, in any kind of programming it is better to convert the string you are comparing to uppercase or lowercase. So if user enters "bangalore", "Bangalore", "bAnGlore", "BANGALORE", everything still resolves to "BANGALORE" in my query and hence works. String comparision is case sensitive.