Skip to content

Commit bc155bc

Browse files
committed
task: #619
1 parent 7acfb84 commit bc155bc

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Have a good contributing!
4444
- [595. Big Countries](./leetcode/easy/595.%20Big%20Countries.sql)
4545
- [596. Classes With at Least 5 Students](./leetcode/easy/596.%20Classes%20With%20at%20Least%205%20Students.sql)
4646
- [610. Triangle Judgement](./leetcode/easy/610.%20Triangle%20Judgement.sql)
47+
- [619. Biggest Single Number](./leetcode/easy/619.%20Biggest%20Single%20Number.sql)
4748
2. [Medium](./leetcode/medium/)
4849
- [176. Second Highest Salary](./leetcode/medium/176.%20Second%20Highest%20Salary.sql)
4950
- [184. Department Highest Salary](./leetcode/medium/184.%20Department%20Highest%20Salary.sql)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Question 619. Biggest Single Number
3+
Link: https://leetcode.com/problems/biggest-single-number/description/
4+
5+
Table: MyNumbers
6+
7+
+-------------+------+
8+
| Column Name | Type |
9+
+-------------+------+
10+
| num | int |
11+
+-------------+------+
12+
This table may contain duplicates (In other words, there is no primary key for this table in SQL).
13+
Each row of this table contains an integer.
14+
15+
16+
A single number is a number that appeared only once in the MyNumbers table.
17+
18+
Find the largest single number. If there is no single number, report null.
19+
*/
20+
21+
SELECT MAX(num) AS num
22+
FROM (
23+
SELECT num
24+
FROM MyNumbers
25+
GROUP BY num
26+
HAVING COUNT(num) = 1
27+
) AS Numbers

0 commit comments

Comments
 (0)