select flow_time,flow_name ,flow_bc_id,flow_dz_id,flow_dept_child_id from flow_info_list a
left join kqInfoList b on a.flow_name=b.kq_id and convert(nvarchar(10),b.kq_date,126)='2007-06-23'
and b.kq_bc=1 and b.kq_dz=1
where b.kq_cur_id is null and
a.flow_bc_id=1 and a.flow_dz_id=1
and convert(nvarchar(10),a.flow_time,126)='2007-06-23'
union all
select kq_date,kq_id,kq_bc,kq_dz,kq_deptchild_id from KqInfoList
where convert(nvarchar(10),kq_date,126)='2007-06-23'
and kq_bc=1 and kq_dz=1 ) c inner join kquserInfo d
on c.flow_name=d.[user_id]