select 1 where somevalue = '' or somevalue is null from sometable
I completely understand the reasoning behind why I have to have two separate conditions. What baffles my mind is why after so many years there still isn’t a standard shortcut notation for this.
I can see why various dbms implementations don’t offer a shortcut since it isn’t necessary and doing so would make your sql that much less portable, but considering the usefulness of such a shortcut across all dbms’s I can’t comprehend why the powers that be haven’t added a shortcut to do this into the sql specifications.
My question: Is there actually a legitimate reason and if so what is it?
You could just
or if you are worried about ‘ ‘ values then you would use ltrim and/or rtrim.