Skip to content

Commit 3c510f8

Browse files
committed
Upload 122
1 parent 4c59a6d commit 3c510f8

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ To make the daily tasks of creating a new file and updating the index easier, th
150150
| 119 | [Product Sales Analysis III](https://leetcode.com/problems/product-sales-analysis-iii/description/) | [Solution](solutions/119_product_sales_analysis_iii.md) | LeetCode | Medium | |
151151
| 120 | [Classes More Than 5 Students](https://leetcode.com/problems/classes-more-than-5-students/description/) | [Solution](solutions/120_classes_more_than_5_students.md) | LeetCode | Easy | |
152152
| 121 | [Find Followers Count](https://leetcode.com/problems/find-followers-count/description/) | [Solution](solutions/121_find_followers_count.md) | LeetCode | Easy | |
153+
| 122 | [Biggest Single Number](https://leetcode.com/problems/biggest-single-number/description/) | [Solution](solutions/122_biggest_single_number.md) | LeetCode | Easy | |
153154

154155
## Author(s)
155156

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SQL Everyday \#122
2+
3+
## Biggest Single Number
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
A *single number* is a number that appeared only once in the `MyNumbers` table.
11+
12+
Find the largest *single number*. If there is no *single number*, report `null`. [[Full Description](https://leetcode.com/problems/biggest-single-number/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
SELECT
19+
MAX(num) AS num
20+
FROM (
21+
SELECT
22+
num
23+
FROM MyNumbers
24+
GROUP BY num
25+
HAVING COUNT(*) = 1
26+
ORDER BY num DESC
27+
) AS n
28+
;
29+
```
30+
31+
## Site Solution
32+
33+
```sql
34+
-- LeetCode Solution
35+
-- Site solution essentially the same.
36+
```
37+
38+
## Notes
39+
40+
TODO
41+
42+
Go to [Table of Contents](/README.md#contents)\
43+
Go to [Overview](/README.md)

0 commit comments

Comments
 (0)