MySQL Forums
Forum List  »  Newbie

MySQL get highest value and delete other rows
Posted by: Martin Kriken
Date: July 06, 2018 05:21AM

MySQL problems here.

I have inserted some reddit posts to a MySQL database called parent_reply.
Columns are: parent_id, comment_id, parent (the body), comment (body), subreddit, unix (time), score.

Now, I've inserted all posts from a file I had, and now I want to go through each comment and see if:
- there are other comments with the **same** parent_id
- compare this comment and if there is a comment that has **better** score and **same** parent_id then delete it

Options: ReplyQuote


Subject
Written By
Posted
MySQL get highest value and delete other rows
July 06, 2018 05:21AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.