题目来源:
leetcode题目,网址:610. 判断三角形 - 力扣(LeetCode)
解题思路:
任意两边之和大于第三边即可组成三角形。
新建字段,然后根据不同条件赋不同值。
解题代码:
# Write your MySQL query statement below
select x,y,z,
(case
when x+y>z and x+z>y and y+z>x then 'Yes'
else 'No'
end) as triangle
from triangle
总结:
case...when...end 完全没印象。