Re: MySQL get highest value and delete other rows
Posted by:
Martin K
Date: July 07, 2018 03:36AM
Yeah, of course, I meant table not database.
An example row would be
(parent_id, comment_id, parent (this is the text of the parent), comment, subreddit, unix, score)
t3_2qyrla, t1_cnas8zv, NULL, Most of us have some family members like this. *Most of my family is like this., exmormon, 420070400, 14
And I was just thinking, what if I used your first query to set a variable (I'm not sure if this is possible with MySQL), and then, another query like:
DELETE FROM parent_reply WHERE @variable.score > score AND @variable.parent_id = parent_id;
Would something like that be possible?