leetcode

Leetcode submissions
git clone git://git.laack.co/leetcode.git
Log | Files | Refs | README

article-views-i.sql (283B)


      1 --Given a list of views for articles that contains
      2 --both the viewer and the author return
      3 --all unique authors who viewed their own articles
      4 --in ascending order by id.
      5 
      6 SELECT DISTINCT Views.author_id AS id
      7 FROM Views
      8 WHERE Views.viewer_id = author_id
      9 ORDER BY Views.author_id ASC