Group By:
SELECT *
FROM (SELECT t.security_name,
t.security_code,
t.l_dataoffer_date,
count(1) kk
FROM zsyh_cjyl_bondnopool t
group by t.security_name, t.security_code, t.l_dataoffer_date)
where kk > 1
group by 用于分组,将列出的相同字段划分到一条记录中。
特殊:select 后面的字段,必须出现在 group by 中,除非该字段被聚合函数使用。
having :在group by 中使用 可对聚合函数操作。