Article Views I

수이·2025년 4월 15일

🟢 코드카타 / SQL

목록 보기
80/88
post-thumbnail

Write a solution to find all the authors that viewed at least one of their own articles.
Return the result table sorted by id in ascending order.
문제링크

조건정리

  1. 한번이라도 자기 아티클을 본 저자의 id
  2. id 오름차순 정렬

풀이

SELECT DISTINCT(author_id) as id
FROM views
WHERE author_id = viewer_id
ORDER BY id

0개의 댓글