select * from user  a
where datediff(day,注册时间,getdate())>15
and not exists(select 1 from 销售表 where 用户ID=a.用户ID and datediff(day,销售日期,getdate())<=15)