Question

I have already searched the internet what is the logic in oracle when using a between function in string but couldn't seem to find or understand it.

For example.

 select 1 from dual
 where 'M9W'  between  'M9W0A0' and 'M9W9Z9'

Why would the above query would not return a row?

Can someone please explain?

Thank you very much.

Était-ce utile?

La solution

String comparison is based on alphabetical order. The string M9W is not alphabetically between M9W0A0 and M9W9Z9. Alphabetically, it comes before both. Alphabetically, it comes before any string M9W<<any character(s) here>>.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top