We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Advanced Select
- Type of Triangle
- Discussions
Type of Triangle
Type of Triangle
Sort by
recency
|
3002 Discussions
|
Please Login in order to post a comment
This Compiler is Corrupted giving same output but saying one is correct another incorrect SELECT
Case when A>0 and B>0 and c>0 and A+B>C and B+C>A and C+A>B then (Case when A=B and B=C then "Equilateral" when A=B or B=C or C=A then "Isosceles" Else "Scalene" End) else "Not a Triangle" end from triangles;/ SELECT
Case WHEN A + B > C AND B + C > A AND A + C > B THEN CASE WHEN A = B AND B = C THEN 'Equilateral' WHEN A = B OR B = C OR A = C THEN 'Isosceles' ELSE 'Scalene' END ELSE 'Not A Triangle' END as hello FROM TRIANGLES;
SQL Server
MY SQL
/* Using nested Case statements */
/* Solving by algorthm. If any of the combined side is less than the leftover side, then the Triangle Inequality Theorm states that it's not a triangle.*/