Friday 15 June 2012

Mysql Select PageId based on count -


Based on how many comments I am trying to select a page ID, this is what I have done so far Is:

  Select the order from page id test.comments;   

How can I select only the page ID and include that order with the amount of those rows? Thank you,

You need to use to complete what you are looking for.

The Group By Statement is used with the total work for the result group determined by one or more columns.

The following query groups have each identical page id (i.e. how many rows based on that page ID) and tells you how many times each id repeats:

  SELECT PageId, COUNT (*) from test.comments by COUNT ID * (*)    

No comments:

Post a Comment