在一个oracle表中,有两列的名称分别为:a和b,其都为number型数据。我想要查询的结果是:满足10<a×b<20的所有结果,请问这个sql语句应该怎么写。是要写成:select * from table where a*b between 10 and 20;吗?

解决方案 »

  1.   

    between会把10和20的也取出的,类似于>=10 and <=20;
    应该改成:
    select * from table where a*b>10 and a*b<20;
      

  2.   


    between是包含有小于等于和大于等于,所以要这样写
    select * from table where a*b>10 and a*b<20
      

  3.   

    select * from table where a*b>10 and a*b <20
      

  4.   

    select * from table where a * b > 10 and a * b < 20;