문제
입력 코드
SELECT ROUND(SUM(TIV_2016),2) AS tiv_2016
FROM insurance
WHERE tiv_2015 IN
(SELECT tiv_2015
FROM insurance
GROUP BY tiv_2015
HAVING COUNT(pid) > 1)
AND (lat, lon) IN
(SELECT lat, lon
FROM insurance
GROUP BY lat, lon
HAVING COUNT(pid) = 1);
코드 설명
#SELECT #ROUND #SUM #GROUP BY #HAVING #COUNT #IN
문제 출처
'SQL' 카테고리의 다른 글
#118. [LeetCode / MySQL] 1667. Fix Names in a Table (0) | 2024.06.20 |
---|---|
#117. [LeetCode / MySQL] 185. Department Top Three Salaries (0) | 2024.06.20 |
#115. [LeetCode / MySQL] 602. Friend Requests II: Who Has the Most Friends (0) | 2024.06.19 |
#114. [LeetCode / MySQL] 1321. Restaurant Growth (0) | 2024.06.18 |
#113. [LeetCode / MySQL] 1341. Movie Rating (0) | 2024.06.18 |