PL/SQL“在x和y之间"如果y< X.为什么? [英] PL/SQL "between x and y" does not work, if y < x. Why?

查看:78
本文介绍了PL/SQL“在x和y之间"如果y< X.为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PL/SQL代码,例如:

I have a PL/SQL code like:

case when column between 201203 and 201201
then other_column
end

我知道列中的值为201203.因此代码应返回一些值.直到我像这样纠正它时才这样:

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

为什么关键字之间的效果如此?如何在Oracle数据库上实现它?

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

推荐答案

这是ANSI SQL行为.

This is ANSI SQL behavior.

 expr1 BETWEEN expr2 AND expr3

翻译为

 expr2 <= expr1 AND expr1 <= expr3

这篇关于PL/SQL“在x和y之间"如果y&lt; X.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆