You are viewing a single comment's thread. Return to all comments →
select case when a+b<=c and b+c<=a and a+c<=b then 'not a triangle'
when a=b and b=c then 'equilateral'
when a=b or b=c or c=a then 'isosceles'
i wrote this code but then why is it showing error for mysql
1) Compare casing of letters in printed strings with those of expected output
2) The 'Not A Triangle' conditions appear to be incorrect
did you get the answer for this ?
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'
THIS WILL WORK NOW IN MYSQL!!!!
It does because the loop will iterate without checking condition