我需要计算visit_numbers和industry_code的fin_sum,但是如果id在其他表中,那么我需要从计算中排除在其他表中具有id的记录,但是,如果id不是表themn中的第十六位,它应该被包括在内SELECT visit_number,
--sum(fin_amount) do not include ids from S
select cust_no,cust_name,sum(bvtotal) as Amountwhere cust_no is not nulland number is not null and bvtotal > 1000 and in_date < 20140101order by sum(bvtotal) desc;
如何排除in_date > 20140101的分组结果?A