22,181
社区成员




--a.
select year(regdate) 注册年份,month(regdate) 注册月份,count(*) 用户数 from C group by year(regdate),month(regdate) --考虑到跨年
--b.
select count(distinct name) from C t where exists(select 1 from C where name=t.name and id <t.id)
--c.
insert A select id,name from C t where exists(select 1 from C where name=t.name and id <t.id)
--d.
select * from C t where not exists(select 1 from C where name=t.name and regdate>t.regdate)