Skip to content

619. Write your PostgreSQL query statement below ​

  • 题号:619
  • 来源:LeetCode
  • 难度:简单
  • 标签:计数
  • 语言:SQL
  • 解法:1 个
  • 作者:lmliheng
  • 最近更新:2026-09-27

SQL · 更新于 2026-09-27

分组筛出只出现一次的数,再取最大值

sql
-- Write your PostgreSQL query statement below
-- @difficulty easy
-- @tags 计数
-- @note 分组筛出只出现一次的数,再取最大值

select MAX(num) as num
from(
select num as num
from MyNumbers 
group by num
having count(num)=1
)

源码:sql/leetcode/619.sql


在 GitHub 上查看题目所在目录:lmliheng/algorithm