Saturday, June 4, 2016

SQL Case in oracle



select case when ((t.a + t.b) <= t.c) or ((t.b + t.c) <= t.a) or ((t.a + t.c) <= t.b) then 'Not A Triangle'
            when t.a = t.b and t.b = t.c then 'Equilateral'
            when t.a = t.b or t.a = t.c or t.b = t.c then 'Isosceles'
            when t.a <> t.b and t.b <> t.c and t.c <> t.a then 'Scalene'
        end as tr
from triangles t;

No comments:

Post a Comment