This website contains ALL LeetCode **Premium** problems for
**FREE!!**.

All leaked interview problems are collected from Internet.

All leaked interview problems are collected from Internet.

Table `number`

contains many numbers in column **num** including duplicated ones.

Can you write a SQL query to find the biggest number, which only appears once.

+---+ |num| +---+ | 8 | | 8 | | 3 | | 3 | | 1 | | 4 | | 5 | | 6 |For the sample data above, your query should return the following result:

+---+ |num| +---+ | 6 |

If there is no such number, just output

b'

\n\n## Solution

\n

\n#### Approach: Using **subquery** and

\n

'
\n

`MAX()`

function [Accepted]**Algorithm**

Use subquery to select all the numbers appearing just one time.

\n\nThen choose the biggest one using `MAX()`

.\n