-
[HackerRank/Advanced Select] Type of Triangle공부/PS ( SQL) 2022. 5. 16. 01:12
https://www.hackerrank.com/challenges/what-type-of-triangle/problem
문제
풀이
SELECT CASE WHEN A = B AND B = C THEN 'Equilateral' WHEN A >= B+C OR B >= A+C OR C >= A+B THEN 'Not A Triangle' WHEN A = B OR B = C OR C = A THEN 'Isosceles' ELSE 'Scalene' END FROM TRIANGLES;
- CASE문
- SELECT
CASE
WHEN 조건 THEN 결과
WHEN 조건 THEN 결과
...
WHEN 조건 THEN 결과
ELSE 결과
END
FROM 테이블명
'공부 > PS ( SQL)' 카테고리의 다른 글
[HackerRank/Aggregation] Revising Aggregations - The Count Function (0) 2022.05.17 [HackerRank/Advanced Select] The PADS (0) 2022.05.16 [HackerRank/Basic Select] Employee Salaries (0) 2022.05.16 [HackerRank/Basic Select] Employee Names (0) 2022.05.16 [HackerRank/Basic Select] Higher Than 75 Marks (0) 2022.05.16