Easy to understand solution


  • 1
    D
    select max(n.num) as num from number n where n.num not in (select num from number group by num having count(num) > 1);
    

  • 0
    V

    My solution using ifnull()

    select ifnull((select num
    from number n
    where (select count(num) from number where num=n.num) = 1
    order by num desc limit 1),null) as 'num'
    

Log in to reply
 

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