MySQL concise solution


  • 1
    A

    Find the max number from the table whose count is 1.

    # Write your MySQL query statement below
    Select 
        max(n.num) as num
    from 
        number n
    where 
        (Select count(num) from number where num = n.num) = 1;
    

  • 0

    Same idea

    select max(a.num) as num
    from (select num from number group by num having count(*)=1) as a

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.