10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edf9431 commit ff09abbCopy full SHA for ff09abb
Solutions/Problem-24.sql
@@ -0,0 +1,22 @@
1
+/* 24.Biggest Single Number :
2
+
3
+Table: MyNumbers
4
++-------------+------+
5
+| Column Name | Type |
6
7
+| num | int |
8
9
+This table may contain duplicates (In other words, there is no primary key for this table in SQL).
10
+Each row of this table contains an integer.
11
12
+A single number is a number that appeared only once in the MyNumbers table.
13
+Find the largest single number. If there is no single number, report null.
14
+*/
15
16
+SELECT MAX(num) AS num
17
+FROM (
18
+ SELECT num
19
+ FROM MyNumbers
20
+ GROUP BY num
21
+ HAVING COUNT(num) = 1)
22
+ AS single_numbers;
0 commit comments