Type of Triangle in MYSQL

前端 未结 18 2155
执念已碎
执念已碎 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:42

    select case
    when A+B <= C or A+C <= B or B+C <= A then "Not A Triangle"
    when A=B and B=C then "Equilateral"
    when A=B or A=C or B=C then "Isosceles"
    else "Scalene"
    end as triangles_type
    from TRIANGLES;
    

提交回复
热议问题