Coding Test/SQL
[LeetCode] 1148. Article Views I (easy, SQL)
lim.dev
2024. 1. 9. 01:12
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
전체 코드
SELECT DISTINCT(viewer_id) as id
FROM Views
WHERE author_id = viewer_id
ORDER BY id
DISTINCT를 쓰면 중복이 제거된다!