Type of Triangle in MYSQL

前端 未结 18 2389
执念已碎
执念已碎 2020-12-09 11:48

Problem statement:

Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the followin

18条回答
  •  隐瞒了意图╮
    2020-12-09 12:45

    For Oracle 11g this is working:

    SELECT CASE WHEN A+B>C then case when A=B AND B=C THEN 'Equilateral'
       WHEN A=B OR B=C OR A=C THEN 'Isosceles'
       WHEN A!=B or B!=C OR A!=C THEN 'Scalene' END
       ELSE 'Not A Triangle' END
       FROM TRIANGLES;
    

提交回复
热议问题