1148. 文章浏览 I

WHERE

https://leetcode.cn/problems/article-views-i/description/

虽说是水题,但还是没能一次过。主要是一开始下意识想着用LEFT JOIN,写到ON去题目找条件的时候,才发现这题好像压根用不上JOIN,再仔细一看确实用不上JOIN,一个WHERE就能搞定。

SQL
# Write your MySQL query statement below
SELECT DISTINCT(A.author_id) AS id
FROM Views AS A 
WHERE A.author_id=A.viewer_id 
ORDER BY A.author_id ASC
Subscribe
提醒
0 评论
Inline Feedbacks
View all comments
0
在此留下你的评论x