mysql - order by count from another table -


I hope this is legal to post because I know about other similar posts on this topic. But I am unable to get other solutions to work, so I am trying to post my own scenario. Much like on other examples like this, I'm not sure how they use tablelines and rows. What is this through punctuation?

  Select bloggers. Bloggers.blogger_id = blogger_posts.blogger_id by bloggers.blogger_id order by bloggers left by POST_COUNT *, COUNT (post_id) POST_COUNT   

I have a table with articles as soon as the bloggers.blogger_id is included, And there is a figure table, which is read every time an article is read. I am trying to create a query that organizes my article table by calculating the number of records for that article ID in the statistics table. Such as "depending on the scenes" function.

My 2 tables:

Articles

  id   

Statistics

  pid & lt; - Similar to the article id   

Other examples include left search Just do not wrap around my head to work that at the moment my query looks like this: $ query = "SELECT * Figures from scenes in the form of COUNT, "GROUP BY pID ORDER BY DESC";

Any help is greatly appreciated!

After "text" itemprop = "text">
  select article *, COUNT (statistics.pid) articles seen from the left Please include stats on article.id as  
  • By using
  • both the Tables are combinations, there is no figure in an article, fill with NULL , i.e. use a left join
  • COUNT only non- < Code> NULL values, so counting from the right table, each article should be given a valid number of results for
  • Group By to the right of each article to get a result row, ie

Comments