- Prepare
- SQL
- Advanced Select
- Type of Triangle
- Discussions

# Type of Triangle

# Type of Triangle

+ 0 comments select case when a+b<=c or c+b<=a or a+c<=b then 'Not A Triangle' when a=b and b=c then 'Equilateral' when a=b or b=c or a=c then 'Isosceles' else 'Scalene' end as type_of_circle from triangles;

+ 0 comments select case when a+b<=c or c+b<=a or a+c<=b then 'Not A Triangle' when a=b and b=c then 'Equilateral' when a=b or b=c or a=c then 'Isosceles' when a!=b and b!=c then 'Scalene' end as type_of_circle from triangles;

+ 1 comment Why at row 8 it is expected to be "Not a triangle?" In my case the output for row 8 is 20 20 40

+ 0 comments SELECT CASE WHEN not(A + B > C and B + C > A and A + C > B) THEN 'Not A Triangle' WHEN A = B and A = C THEN 'Equilateral' WHEN (A = B or B = C or C = A) THEN 'Isosceles' ELSE 'Scalene' END FROM TRIANGLES;

+ 0 comments **MS SQL SERVER**SELECT CASE WHEN (A = B AND A = C AND B = C ) THEN 'Equilateral' WHEN (A = B OR A = C OR B = C ) AND (A+B > C) THEN 'Isosceles' WHEN (A != B AND A != C AND B != C ) AND (A+B > C) THEN 'Scalene' ELSE 'Not A Triangle' END AS 'TRIANGLES NAMES' FROM TRIANGLES;

Sort 1790 Discussions, By:

Please Login in order to post a comment