Ok,我有两个MYSQL表:
CREATE TABLE `sessions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userID` int(11) NOT NULL,
`runTime` int(11) NOT NULL,
`monstersKilled` int(11) NOT NULL,
`profit` int(11) NOT NULL,
`tasks` int(11) NOT NULL,
`xpGain` int(11) NOT NULL,
`lastupdate` int(11) NOT NULL,
PRIMARY KEY (`id`)
);
而且,
CREATE TABLE `users` (
`userid` int(11) NOT NULL AUTO_INCREMENT,
`user` text NOT NULL,
`pass` text NOT NULL,
`paypal` text NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT 0 ,
`strikes` int(11) NOT NULL DEFAULT 0 ,
`session` text NOT NULL,
`brand` text NOT NULL,
`identifier` text NOT NULL,
PRIMARY KEY (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=651 DEFAULT CHARSET=latin1;
如你所知,会议与用户识别仪有链接。 现在,我想提供全部高分数的购买力平价文件,但我很少了解营地,很少了解MYSQL I的开端。 总得分将按总运行时间分类。
Example: In users I have user #1 (cody) & user #2 (Joe). Now, In sessions I have 3 sessions:
id, userID, runTime, monstersKilled, profit, tasks, xpGain, lastupdate
12, 1, 27, 14, 6200, 0, 5050, 1282325410
19, 1, 18, 1, 277, 1, 168, 1278897756
1968, 2, 195, 433, 111345, 4, 73606, 1280993244
印本应符合以下各条:
Place, username, Total Run Time, Total Monsters Killed, Total profit, Total tasks, Total Exp Gain
1. Joe, 195, 433,11345,4,73606
2. Cody, 55, 15, 1, 5218