HOW TO GET MULTIPLE COUNT IN SQL

benjamin richards

Total Post:4

Points:28
Posted by  benjamin richards
 1178  View(s)
Ratings:
Rate this:

Hi MindStickians!

I have a table in my database in which I have three columns:

[Article_ID] INT IDENTITY PRIMARY KEY,
[Article_Title] NVARCHAR(Max),
[Article_Rating] INT

Now the user can enter a maximum number 5 in rating and minimum 1 now I have to query that how many times users entered 1, how many times 2, how many times

3, how many times 4 and how many times 5

Thanks in advance.

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: How to get multiple count in sql

    Hi Benjamin!


    Try this SQL Query that fulfill your requirement  

    SELECT [ARTICLE_RATING],COUNT(Article_Rating) [Total_Count] FROM [COUNT_DETAILS] GROUP BY [Article_Rating]

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!