I have a table:
CREATE TABLE `like` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`like` tinyint(1) NOT NULL DEFAULT '0',
`userid` int(10) NOT NULL,
`dateline` int(10) NOT NULL,
`to_userid` int(10) NOT NULL
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I would like to have a list for the last twelve months, showing the to_userid with the highest sum of like, next to the month and year.
edit: dateline is stored as unix time.
Can anyone help with this please?