Home > Database > Mysql Tutorial > 使用partition建立RANGE类型按TO_DAYS划分的表分区

使用partition建立RANGE类型按TO_DAYS划分的表分区

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:55:42
Original
1850 people have browsed it

mysql中对数据表有RANGE,LIST,HASH,KEY四种类型的分区方式。下面为按照RANGE进行分区的方式: create table sales2 ( id NUMERIC,sale_date datetime not null)PARTITION by range(TO_DAYS(sale_date))( PARTITION sales20140301 values less than(TO_DAY

mysql中对数据表有RANGE,LIST,HASH,KEY四种类型的分区方式。下面为按照RANGE进行分区的方式:

create table sales2 ( id NUMERIC,sale_date datetime not null)
PARTITION by range(TO_DAYS(sale_date))
(
   PARTITION sales20140301 values less than(TO_DAYS('2014-03-01')),
   PARTITION sales20140401 values less than(TO_DAYS('2014-04-01'))
)
Copy after login
TO_DAYS('2014-03-01') 时间并不包括当前的时间,而是此前的日期。
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template