oracle中between

oracle中between and包含边界值,也就是所谓的闭区间。

如 between 1 and 100,则表示包含1和100及以内的一切数值。

如以下语句:

1
2
3
4
5
6
7
8
9
10
11
12
13
select name,
       score,
       case
         when score >= 90 then
          '优秀'
         when score between 70 and 89 then
          '良好'
         when score between 60 and 69 then
          '及格'
         when score < 60 then
          '不及格'
       end 等级
  from test;

则代表:90分及以上为优秀,70分-89分为良好,60-69分为及格,60分以下为不及格。

原文地址:https://www.cnblogs.com/toSeeMyDream/p/5947723.html