Amit Soni
We have a table with one field name {amit,amit,karan,karan,sumit},write a query to show the name and number of its occurrence.
By Amit Soni in SQL on Feb 26 2007
  • Sanjeev Kumar
    Jul, 2016 19

    select name,COUNT(Name) from tablename group by Name

    • 0
  • Rahul Prajapat
    May, 2015 30

    Select [Name], Count([Name]) times from Table group by[Name]

    • 0
  • Pankaj  Kumar Choudhary
    May, 2015 22

    Select [Name], Count([Name]) Occ from Table group by[Name]

    • 0
  • Dinesh Rathi
    Mar, 2007 7

    Select [Name],Count([Name]) as Times from TableName group by [Name]

    • 0
  • Mar, 2007 1

    SELECT name,COUNT(*)

    FROM emp  --emp is the name of the table that contain column name

    GROUP BY name

    HAVING COUNT(*)>=1

    • 0
  • Johnny
    Feb, 2007 26

    This seems to work... SELECT field_name,count(*) FROM table_name group BY field_name

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS