I will try to describe briefly the problem, namely: I have a page where there are about 1000 profiles. Each profile has its own comments with different dates.
What I would like to do is write a code that would take from each profile 3 last comments and add them + 6 months.
I made sample code to add those 6 months:
UPDATE sktest
.wp_comment
SET time
= DATE_ADD(time
, INTERVAL 6 MONTH)
WHERE date(wp_comment
.time
) BETWEEN “2015-05-01” AND “2016-06-01”
Unfortunately, I have no idea how to get only 3 last comments in each profile. Does anyone have any suggestions? Ideas?
Comments I keep in the wp_comment table, which looks like this: