Biggest Single Number - LeetCode
Can you solve this real interview question? Biggest Single Number - Table: MyNumbers +-------------+------+ | Column Name | Type | +-------------+------+ | num | int | +-------------+------+ There is no primary key for this table. It may contain duplicates
leetcode.com
1
2
3
4
5
6
7
8
9
10
11
|
# Write your MySQL query statement below
select max(num) as num
from MyNumbers
where num in
(
select num
from MyNumbers
group by num
having count(num) = 1
order by num desc
)
|
cs |
반응형
'SQL' 카테고리의 다른 글
leetcode 1731. The Number of Employees Which Report to Each Employee (0) | 2023.06.16 |
---|---|
leetcode 1211. Queries Quality and Percentage (0) | 2023.06.13 |
leetcode 1517. Find Users With Valid E-Mails (0) | 2023.06.07 |
leetcode 1633. Percentage of Users Attended a Contest (0) | 2023.06.01 |
leetcode 570. Managers with at Least 5 Direct Reports (0) | 2023.06.01 |
댓글