#106. [LeetCode / MySQL] 610. Triangle Judgement

문제

 

입력 코드

1. 

SELECT x, y, z, 
  (CASE
    WHEN x+y <= z THEN 'No'
    WHEN x+z <= y THEN 'No'
    WHEN y+z <= x THEN 'No'
    ELSE 'Yes'
  END) AS triangle
FROM Triangle

 

2. 

SELECT x, y, z, 
  IF(X+Y > Z 
      AND Y+Z > X 
      AND Z+X > Y, "Yes", "No") AS Triangle
FROM Triangle

 

 

코드 설명

#SELECT #CASE WHEN #ELSE #IF 

 

 

문제 출처

 

LeetCode - The World's Leading Online Programming Learning Platform

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com