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.
| Author |
Topic |
|
daniel50096230
Yak Posting Veteran
99 Posts |
Posted - 2011-08-25 : 07:59:33
|
| Hi,I have a query here. SELECT Product_ID From ProductsEg. The results I get is as below:Product_IDAABCDHow can I count how many times the product appear in the query? The result I want to get is as below:Product_ID TimesA 2B 1C 1 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-25 : 08:03:00
|
| [code]SELECT Product_ID,COUNT(*) as TimesFROM ProductsGROUP BY Product_ID[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|