a表 字段id,name,wei_id,sex,age,c_cardid 。b表字段code,date,goods
a.id不重复,b.code=a.id中的数值可重复
select a.id,a.name from a
where  a.weixin_id is not null and (c_cardid between '00000001' and '99999999')
and a.id in(select b.code from b where b.date between '2016-11-10 13:00:00.000'and '2016-11-11 13:00:00.000' )
查询a.wei_id不为空值时b中某时间段的数据
要求同时显示a,b的数据
即显示为
a.id  | a.name  | b.date  | b.goods