Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I had a column in SQL Table like this
      SUPPLIER ID
          1
          1
          2
          1
          3
          2
          2
          3
          1
          3
How to find the SUPPLIER ID values no of times repeated here, 

for eg:  here 1 repeated for 4 times like wise i need for all the numbers 

can any 1 helps to write this query
Posted
Updated 20-Jun-13 21:29pm
v3
Comments
Rajesh Anuhya 21-Jun-13 3:20am    
Looks like no effort

Are you looking for this?
select SUPPLIERID,count(*) from Mytable group by SUPPLIERID


Thanks
--RA
 
Share this answer
 
Comments
kesav prakash 21-Jun-13 3:26am    
it dose't works can u send me the exact Query
Rajesh Anuhya 21-Jun-13 3:29am    
What is the Error?, You need to change the Query as per your table name and columns, post your Query ..
--RA
Prasad_Kulkarni 21-Jun-13 3:30am    
5'ed!
Something like this:
SQL
SELECT
  category,
  COUNT(*) AS `num`
FROM
  posts
GROUP BY
  category
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900