What Is wrobg in this MySQL query? It is showing syntax error.
SELECT
CASE
WHEN A = B
CASE
WHEN A = C THEN 'Equilateral'
WHEN C < A + B THEN 'Isosceles'
ELSE 'Not A Triangle'
END
WHEN B = C
CASE
WHEN A < B + C THEN 'Isosceles'
ELSE 'Not A Triangle'
END
WHEN A + B > C AND A + C > B AND B + C > A THEN 'Scalene'
ELSE 'Not A Triangle'
END
FROM TRIANGLES;
You have to add also a then for that purpose
SELECT
CASE
WHEN A = B
THEN
CASE
WHEN A = C THEN 'Equilateral'
WHEN C < A + B THEN 'Isosceles'
ELSE 'Not A Triangle'
END
WHEN B = C
THEN
CASE
WHEN A < B + C THEN 'Isosceles'
ELSE 'Not A Triangle'
END
WHEN A + B > C AND A + C > B AND B + C > A THEN 'Scalene'
ELSE 'Not A Triangle'
END
FROM TRIANGLES;