select c.cus_name,tsdz_sum=isnull(count(*),0) from a_rel a inner join b_rel b on a.entry_id=b.entry_id where date1 between date2 and date3 group by C.cus_name
没有 c 改为以下语句试试: select b.cus_name,tsdz_sum=isnull(count(*),0) from a_rel a inner join b_rel b on a.entry_id=b.entry_id where date1 between date2 and date3 group by b.cus_name
this can't !i write wrong ,should b.cus_name! but still not affect
改为以下语句试试:
select b.cus_name,tsdz_sum=isnull(count(*),0) from a_rel a inner join b_rel b on a.entry_id=b.entry_id where date1 between date2 and date3 group by b.cus_name
but still not affect