Word count statistics

Source: Internet
Author: User
How does one count the number of articles owned by each author? In addition, the maximum number of articles displayed is the first one) the total number of words in the article content is displayed in the list. The second one is the number of articles. The second one is displayed in the list, and so on, you are going to make an article to count the number of words
Article table
Id author titile content
How to count the number of articles owned by each author and sort the number of articles from many to few
Is the first to display the maximum number of articles (the maximum number of displayed articles) in the total number of words
Next, use the list to display the titles.
The second is to display the second-largest number of articles.

And so on
I don't have a good idea. I think it's too troublesome. I want to learn a good idea.

------ Solution --------------------
What are you going to do? I can tell you how to count the number of words in an article in a simple way.
------ Solution --------------------
SQL code
SELECT id, titile, SUM (LENGTH (titile) AS lengthFROM 'Your _ table' where author = '". $ author." 'Order by length desc
------ Solution --------------------
SQL code
Select count (*) as count, author, sum (length (content), group_concat (title) group by authororder by count DESC
------ Solution --------------------
An SQL statement cannot be used. Use foreach. The author is outside, and the article title list is inside.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.