我的数据库中有分区表,如下所示:
mysql> 显示创建表 drug_info\G;
Table: drugs_info
Create Table: CREATE TABLE `drugs_info` (
`did` int(11) NOT NULL AUTO_INCREMENT,
`brand_name` varchar(150) DEFAULT NULL,
`generic` varchar(500) DEFAULT NULL,
`tradename` varchar(150) DEFAULT NULL,
`manfactured` varchar(100) DEFAULT NULL,
`unit` varchar(300) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`quantity` varchar(50) DEFAULT NULL,
`price` float DEFAULT NULL,
PRIMARY KEY (`did`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (did) (PARTITION p0 VALUES LE
SS THAN (1000) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (2000) ENGINE = InnoDB, PARTITION
p2 VALUES LESS THAN MAXVALUE ENGINE = InnoD
我写了一个选择查询,因为'partition po'
它显示错误的结果如下:
mysql> select count(*) from drugs_info p0;
count(*)
----------
64378
对于上述选择查询,我将以下结果除外:
count(*)
---------
1000