Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update sql solution to lc problem: No.2020 #1901

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: update sql solution to lc problem: No.2020
  • Loading branch information
thinkasany committed Oct 30, 2023
commit c9f4030cba43d631bfbd5d6324d84259e445cf8a
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ Streams table:

```sql
# Write your MySQL query statement below
SELECT COUNT(DISTINCT sub.account_id) AS accounts_count
SELECT COUNT(sub.account_id) AS accounts_count
FROM
Subscriptions AS sub
LEFT JOIN Streams AS ss ON sub.account_id = ss.account_id
LEFT JOIN Streams USING (account_id)
WHERE
YEAR(start_date) <= 2021
AND YEAR(end_date) >= 2021
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ User 11 did not subscribe in 2021.

```sql
# Write your MySQL query statement below
SELECT COUNT(DISTINCT sub.account_id) AS accounts_count
SELECT COUNT(sub.account_id) AS accounts_count
FROM
Subscriptions AS sub
LEFT JOIN Streams AS ss ON sub.account_id = ss.account_id
LEFT JOIN Streams USING (account_id)
WHERE
YEAR(start_date) <= 2021
AND YEAR(end_date) >= 2021
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Write your MySQL query statement below
SELECT COUNT(DISTINCT sub.account_id) AS accounts_count
SELECT COUNT(sub.account_id) AS accounts_count
FROM
Subscriptions AS sub
LEFT JOIN Streams AS ss ON sub.account_id = ss.account_id
LEFT JOIN Streams USING (account_id)
WHERE
YEAR(start_date) <= 2021
AND YEAR(end_date) >= 2021
Expand Down