php - Count/Group By/Order By is only showing the count of the most common value and not the string itself -


I'm query from a table to find the common string in a column. However, this is not working properly. It should return the value of the most common string, but instead of returning the number of times the most common string is present. Query:

  select COUNT in (field_review_bar_tab_2_value) `Rows` the Rows` DESC limit Adesh` (by field_data_field_review_bar_tab_2) Group (field_review_bar_tab_2_value) 1   < P> Table structure, simple, will have something for the effect:  
  -------------------------- --------- | ID | Field_review_bar_tab_2_value | | ---- + ------------------------- | | 1 | Food Drinks | | 2 | Drinks | | 3 | Food Drinks | | 4 | Food | -----------------------------------   

The query is to recognize that In the above example, the most common string in the "food beverage" column is However, any idea as "food and drinks" instead query "2" return among the reasons that make it right but query will return the number of results rather than the value of the string?

Select> need to include field_review_bar_tab_2_value list as well I Overall COUNT (*), and the < code> covers grouped columns in SELECT .

  SELECT field_review_bar_tab_2_value as_most_common_string, COUNT (*) `Rows` the (field_data_field_review_bar_tab_2) Rows` by Group by (field_review_bar_tab_2_value) Adesh` DESC limit 1    

Comments