how about this:

回答: Please help in SQL code and Thank youluck20102011-01-08 16:28:50

select c.cust_nam, count(s.qty_sold) as qty_sold Total
from customers c inner join sales s
     on c.cust_id = s.cust_id
where s.sale_dat >= ‘20100101’and  s.sale_dat <= ‘20101231’
group by c.cust_nam

請您先登陸,再發跟帖!