I am trying to make a stored proc that will count the number of times each company comes up but keep the number of times the company comes up. Here is an example of my data set.
Company | ID | Topic | Details
1 25 RD TBD
1 25 RD TBD
2 26 RD TBD
3 27 RD TBD
3 27 RD TBD
3 27 RD TBD
I want the final result of the query to be with it ordered by the count :
Company | ID | Topic | Details | Count
3 27 RD TBD 3
3 27 RD TBD 3
3 27 RD TBD 3
1 25 RD TBD 2
1 25 RD TBD 2
2 26 RD TBD 1
Is this possible in SQL?
Thanks in advance!
Company | ID | Topic | Details
1 25 RD TBD
1 25 RD TBD
2 26 RD TBD
3 27 RD TBD
3 27 RD TBD
3 27 RD TBD
I want the final result of the query to be with it ordered by the count :
Company | ID | Topic | Details | Count
3 27 RD TBD 3
3 27 RD TBD 3
3 27 RD TBD 3
1 25 RD TBD 2
1 25 RD TBD 2
2 26 RD TBD 1
Is this possible in SQL?
Thanks in advance!