How many times search keyword used

hi all

i have search table


search_id    search_keywords

1              samsung galaxy
2               s4
3               s4
4               s4
5              nokia lumia

if i do a query

select * from search_table group by search_keywords

then i get 3 rows


serial no.     search_words

1        samsung galaxy
2        s4
3        nokia lumia

now while displaying results i want to show one more column telling “how many times each keyword was added”

so the result should be


serial no.     search_words        how many times added

1              samsung galaxy            1 time
2              s4                        3 times
3              nokia lumia               1 time

how can i display values in 3rd column telling “how many times each keyword was added” ??

thanks
vineet

You need to add a count

SELECT search_keywords
     , COUNT(*) AS keyword_count
  FROM search_table 
 GROUP BY search_keywords
1 Like

Thanks DaveMaxwell

ALL WORKING FINE NOW

VINEET

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.