Skip to content

Commit bf78ec4

Browse files
authored
feat: update sql solution to lc problem: No.1939 (#1816)
* feat: update sql solution to lc problem: No.1939 * fix: optimize
1 parent 01badef commit bf78ec4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

solution/1900-1999/1939.Users That Actively Request Confirmation Messages/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ Result table
8888
<!-- 这里可写当前语言的特殊实现逻辑 -->
8989

9090
```sql
91-
SELECT DISTINCT
92-
c1.user_id AS user_id
91+
SELECT DISTINCT user_id
9392
FROM
9493
Confirmations AS c1
95-
INNER JOIN Confirmations AS c2 ON c1.user_id = c2.user_id
94+
JOIN Confirmations AS c2 USING (user_id)
9695
WHERE
9796
c1.time_stamp < c2.time_stamp
9897
AND TIMESTAMPDIFF(SECOND, c1.time_stamp, c2.time_stamp) <= 24 * 60 * 60;

solution/1900-1999/1939.Users That Actively Request Confirmation Messages/README_EN.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,10 @@ User 7 requested two messages within 24 hours and 1 second of each other, so we
9191
### **SQL**
9292

9393
```sql
94-
SELECT DISTINCT
95-
c1.user_id AS user_id
94+
SELECT DISTINCT user_id
9695
FROM
9796
Confirmations AS c1
98-
INNER JOIN Confirmations AS c2 ON c1.user_id = c2.user_id
97+
JOIN Confirmations AS c2 USING (user_id)
9998
WHERE
10099
c1.time_stamp < c2.time_stamp
101100
AND TIMESTAMPDIFF(SECOND, c1.time_stamp, c2.time_stamp) <= 24 * 60 * 60;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
SELECT DISTINCT
2-
c1.user_id AS user_id
1+
SELECT DISTINCT user_id
32
FROM
43
Confirmations AS c1
5-
INNER JOIN Confirmations AS c2 ON c1.user_id = c2.user_id
4+
JOIN Confirmations AS c2 USING (user_id)
65
WHERE
76
c1.time_stamp < c2.time_stamp
87
AND TIMESTAMPDIFF(SECOND, c1.time_stamp, c2.time_stamp) <= 24 * 60 * 60;

0 commit comments

Comments
 (0)