准备数据:
DROP TABLE IF EXISTS `t_player`; CREATE TABLE `t_player` ( `player_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) NOT NULL, `country` int(11) NOT NULL, `money` int(11) NOT NULL, PRIMARY KEY (`player_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `t_player` VALUES ('1', '张三', '1', '1000'); INSERT INTO `t_player` VALUES ('2', '李四', '1', '1500'); INSERT INTO `t_player` VALUES ('3', '王五', '1', '2000'); INSERT INTO `t_player` VALUES ('4', '马六', '1', '2500'); INSERT INTO `t_player` VALUES ('5', 'zhangsan', '2', '1000'); INSERT INTO `t_player` VALUES ('6', 'lisi', '2', '1500'); INSERT INTO `t_player` VALUES ('7', 'wangwu', '2', '2000'); INSERT INTO `t_player` VALUES ('8', 'maliu', '2', '2500'); INSERT INTO `t_player` VALUES ('9', 'zhangsanhe', '3', '1200'); INSERT INTO `t_player` VALUES ('10', 'lisihehe', '3', '2000'); INSERT INTO `t_player` VALUES ('11', 'wangwuhe', '3', '2500'); INSERT INTO `t_player` VALUES ('12', 'maliuhe', '3', '1800'); INSERT INTO `t_player` VALUES ('13', 'wujiandao', '4', '2500');各种查询: