문제

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.

도움이 되었습니까?

해결책

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>>.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top