Friday, August 26, 2011

How to find the total amount of a Customer in By using Sql Query ?

How  to Find The Total Amount of one  customer who purchase number of products ?


Select C.CustomerId,C.CustomerName, sum(Amount) as Total From Customers C,Sales S
where C.CustomerId=S.CustomerId
group by C.CustomerId,C.CustomerName