👉 https://leetcode.com/problems/article-views-i/description/?envType=study-plan&id=sql-i
Article Views I - LeetCode
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
🤔 문제 분석
1) Write an SQL query to find all the authors that viewed at least one of their own articles.
2) Return the result table sorted by id in ascending order.
💡 풀이
SELECT DISTINCT author_id as id
FROM Views
WHERE author_id = viewer_id
ORDER BY id
'코딩테스트 > 리트코드 SQL' 카테고리의 다른 글
[리트코드/SQL] 19. Sales Person (607) (0) | 2022.12.18 |
---|---|
[리트코드/SQL] 18. Rising Temperature (197) (0) | 2022.12.18 |
[리트코드/SQL] 16. Customer Who Visited but Did Not Make Any Transactions (1581) (0) | 2022.12.18 |
[리트코드/SQL] 15. Combine Two Tables (175) (0) | 2022.12.18 |
[리트코드/SQL] 14. Second Highest Salary (176) (0) | 2022.12.16 |
댓글