Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
How Do I know a) how many packets are present for each destination state?
CA - 4MA - 3WA - 2WY - 1
b) Top 2 States with Highest no of pakages
CA - 4MA - 3
robvolk
Most Valuable Yak
15732 Posts
Posted - 2010-12-06 : 15:12:14
SELECT Destination, Count(*) FROM TrackingTable GROUP BY Destination ORDER BY Count(*) DESCSELECT TOP 2 Destination, Count(*) FROM TrackingTable GROUP BY Destination ORDER BY Count(*) DESC