56,803
社区成员




//表
CREATE TABLE tt (
`_id` int(11) NOT NULL AUTO_INCREMENT,
`_keyValue` int(11) DEFAULT NULL COMMENT '主键值'
`_orderCode` int(11) DEFAULT NULL COMMENT '排序码',
PRIMARY KEY (`_id`)
)
select _id , _keyvalue ,_ordercode
from tt
group by _keyvalue
--表语句
CREATE TABLE tt (
`_id` int(11) NOT NULL AUTO_INCREMENT,
`_keyValue` int(11) DEFAULT NULL COMMENT '主键值'
`_orderCode` int(11) DEFAULT NULL COMMENT '排序码',
)
--插入数据
INSERT INTO `tt` VALUES (1,1,1);
INSERT INTO `tt` VALUES (2,2,1);
INSERT INTO `tt` VALUES (3,3,1);
INSERT INTO `tt` VALUES (4,1,0);
INSERT INTO `tt` VALUES (6,1,1);
INSERT INTO `tt` VALUES (8,5,1);
INSERT INTO `tt` VALUES (11,8,1);
INSERT INTO `tt` VALUES (12,10,1);
INSERT INTO `tt` VALUES (15,12,1);
INSERT INTO `tt` VALUES (52,2,0);