Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL Server view Count of Part Number

Posted on 2011-10-25
2
Medium Priority
?
198 Views
Last Modified: 2012-05-12
I have a view in SQL server that displays part numbers.  I want to count the number of times each part number is present.  There are several hundred part numbers.  
Example below:
96475
96475
98112
98113
98114
98272
98272
98272

96475 should return 2
98272 should return 3
all the others should return 1

Not sure how to add a count field to the view.
0
Comment
Question by:sannunzi
2 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 2000 total points
ID: 37026072
SELECT PartNumber, COUNT(*) AS Total
FROM Yourview
GROUP BY PartNumber

Greg

0
 

Author Comment

by:sannunzi
ID: 37026404
Thanks for the quick response
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question