检查数据库是否支持表分区 show plugins; partition ACTIVE STORAGE ENGINE NULL GPL这项表示支持
创建分区表 create table bookinfo( book_id int, book_name varchar(20) ) partition by range(book_id)( partition p1 values less than(20109999), partition p2 values less than(20159999), partition p3 values less than MAXVALUE );
插入数据 insert into bookinfo values(20170005,'t3');
查看分区P1的数据 select * from bookinfo partition(p1);