CREATE TABLE lineitem(l_orderkey DECIMAL(10,0) NOT NULL, l_cpartkey INTEGER, l_suppkey INTEGER, l_linenumber INTEGER, l_quantity DECIMAL(12,2), l_extendedprice DECIMAL(12,2), l_discount DECIMAL(12,2), l_tax DECIMAL(12,2), l_returnflag CHAR(1), l_linestatus CHAR(1), l_shipdate DATE, l_commitdate DATE, l_receiptdate DATE, l_shipinstruct CHAR(25), l_shipmode CHAR(10), l_comment VARCHAR(44)) PARTITION BY RANGE(l_shipdate) (STARTING MINVALUE, STARTING '1/1/2000' ENDING '31/12/2020' EVERY 1 YEAR(
按月就是 MONTH), ENDING MAXVALUE)创建
分区:ALTER TABLE tablename ADD PARTITION statis_month STARTING'201301'
INCLUSIVE ENDING '20090102' INCLUSIVE。
查询分区select * from syscat.datapartitions t where tabschema =模式名 and tabname = 表名
评论列表(0条)