DEV Community

Nw3965
Nw3965

Posted on

Corrected Code: List Typo

LeetCode

1st try.

I remembered that I have to use From~ table name.

SELECT id
From Views WHERE Column Name 4 AND 7 AS id
Enter fullscreen mode Exit fullscreen mode

2nd try with AI.

SELECT DISTINCT V.viewer_id AS id
FROM Views V
JOIN Views A ON V.viewer_id = A.author_id AND V.article_id = A.article_id
ORDER BY id;
Enter fullscreen mode Exit fullscreen mode

Must study "JOIN ~ ON" and "ORDER BY".

Top comments (0)