1148. 文章浏览 I

96 阅读1分钟

1148. 文章浏览 I

image.png 考察DISTINCT as ORDER BY

select DISTINCT author_id as id from Views 
where author_id=viewer_id ORDER BY id

从Views表中选取author_id列的值
使用DISTINCT去除重复值
alias author_id为id
使用ORDER BY对id列排序输出结果为Views表中author_id列的不重复值集合,有序。