Answer the question
In order to leave comments, you need to log in
You need to select the 100th entry for each user
Here is an interesting task for the local bright minds.
There is a MySQL table:
CREATE TABLE `post` (
`post_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`post_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Answer the question
In order to leave comments, you need to log in
SELECT user_id,(SELECT ps2.post_id from post ps2 WHERE ps2.user_id=p.user_id ORDER BY ps2.post_id LIMIT 100,1 ) as post_id FROM (
SELECT DISTINCT user_id FROM post
) p
It?
stackoverflow.com/questions/858746/how-do-you-select-every-n-th-row-from-mysql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question