WordPress.org

Forums

Retrieving comment with longest length (4 posts)

  1. MaxT
    Member
    Posted 11 years ago #

    SELECT MAX(comment_content) FROM wp_comments;
    Next time try the manual
    Regards, MaxT

  2. jcairns
    Member
    Posted 11 years ago #

    That doesn't do what I asked.
    I want to return all the fields for the comments (there could be more than one) that have the longest length. Your query merely returns the comment's content that has the maximum length.

  3. MaxT
    Member
    Posted 11 years ago #

    Try to read what you wrote:

    For statistical purposes I want to retrieve the comments that have the longest length

    See that? That can be misunderstanded... Next time try to make it more narrow /exact what is it you are looking for...
    And for the record

    I want to return all the fields for the comments (there could be more than one) that have the longest length.

    In english word "longest" means the one that have the greatest value of all possible... And there can be only 1 longest comment...
    Try to restate what you want...

  4. MaxT
    Member
    Posted 11 years ago #

    I didn't read your sql at all in the first run as you said it didn't worked...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.