Weather Observation Station 7

  • + 11 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.