Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a PL/SQL code like:

case when column between 201203 and 201201
then other_column
end

I know that there are values in column that are 201203. So code should return some values. But it didn't until I corrected it like:

case when column between 201201 and 201203
then other_column
end

Why between keyword works like that? How it is implemented on Oracle Databases?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

This is ANSI SQL behavior.

 expr1 BETWEEN expr2 AND expr3

translates to

 expr2 <= expr1 AND expr1 <= expr3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...