自己想的,尚未驗證。
select 身份證號,count(身份證號) 次數 from
(select distinct 身份證號 from 表 where 日期='20100101'
union all
select discinct 身份證號 from 表 where 日期='20111212'
union all
select discinct 身份證號 from 表 where 日期='20110303' )
group by 身份證號 having count(身份證號)>3
自己想的,尚未驗證。
select 身份證號,count(身份證號) 次數 from
(select distinct 身份證號 from 表 where 日期='20100101'
union all
select discinct 身份證號 from 表 where 日期='20111212'
union all
select discinct 身份證號 from 表 where 日期='20110303' )
group by 身份證號 having count(身份證號)>3