I have a list of valid states say 'dc', 'Nu', 'tN', 'VA'. I also have a list of invalid/junk states say 'aa', 'BB', 'CC'
Now I want to do an update that will update the valid states in upper case so that I can get the following updated data: 'DC', 'NU', 'TN', 'VA'
This will not work:
update states set state = upper(state) where state in ('DC', 'NU', 'TN', 'VA');
Any way to update small case to CAPS if its valid one?
UPDATE:
I can have a particular state in any case e.g. 'DC' or 'dc' or 'dC' or 'Dc'. Obviously I can do something like update states set state = upper(state) where state in ('DC', 'dc', 'dC', 'Dc')
. But its a extra mentioning multiple times for the same state. Isn't there any elegant way?