Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 each country total products

Author  Topic 

cognos
Starting Member

10 Posts

Posted - 2011-10-19 : 02:18:31
i have country and products.i have to show total products for each country.


ddd

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-19 : 04:25:09
group by country and take sum(products)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sqlmaster555112
Starting Member

13 Posts

Posted - 2011-10-19 : 13:15:03
Hi check this

Select country,count(products) from cognos_table
group by country
This will give u the count of products for each country.....

@sqlmaster

http://www.intelcs.com/SQL_Server_Consultant.aspx
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-10-21 : 03:13:32
quote:
Originally posted by sqlmaster555112

Hi check this

Select country,count(products) from cognos_table
group by country
This will give u the count of products for each country.....

@sqlmaster

http://www.intelcs.com/SQL_Server_Consultant.aspx


The OP wants total of products so count should be SUM

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -