Home > OS >  Is there any alternative way which i can use instead of "<" in CASE Statement? Oracle s
Is there any alternative way which i can use instead of "<" in CASE Statement? Oracle s

Time:08-29

Is there any alternative way which I can use instead of "<" in CASE Statement?

that is my table:

create table table (id, numbrr) as
 select   1, 450  from dual union all
select   2, 120 from dual union all
select   33, 130 from dual ;

that is my sql script:

select id, number, case when numbrr < 400 then 'Yes' end result
from table

In real table I have a lot of data and will not work this script (I can't write that much data by hand)

case when number in (120,130) then 'Yes' end result

CodePudding user response:

You can use BETWEEN clause:

     select id, number,
            case when number between 0 and 400 
                  then 'Yes' 
            end result
       from table1;

Thank you

  • Related