请教一下 timeid 53 、 57是两个队伍 |
|
40分 |
DROP TABLE IF EXISTS `teamtb`;
CREATE TABLE `teamtb` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `teamid` INT(11) DEFAULT NULL, `name` VARCHAR(20) DEFAULT NULL, `paytime` DATETIME DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=INNODB DEFAULT CHARSET=utf8; INSERT INTO teamtb(teamid,NAME,paytime) SELECT teamid,MAX(paytime) FROM teamtb GROUP BY teamid ORDER BY paytime DESC |
order by 不用也可以 |
|
谢谢
忘记用MAX()这个函数了 一个劲的排序 分组 |