Greenplum分区

2023-03-01 00:00:00 数据 专区 订阅 付费 分区

list分区

建立分区

create table test_partition_list ( id int, name varchar(64), fdate varchar(10) ) distributed by (id) 
partition by list (fdate)
(
partition p1 values ('2017-01-01', '2017-01-02'),
partition p2 values ('2017-01-03'),
default partition pd
);

添加数据

insert into test_partition_list values(1,'aa','2017-01-01');
insert into test_partition_list values(2,'aa','2017-01-01');
insert into test_partition_list values(3,'aa','2017-01-01');

insert into test_partition_list values(4,'aa','2017-01-02');
insert into test_partition_list values(5,'aa','2017-01-02');
insert into test_partition_list values(6,'aa','2017-01-02');

insert into test_partition_list values(7,'aa','2017-01-03');
insert into test_partition_list values(8,'aa','2017-01-03');
insert into test_partition_list values(9,'aa','2017-01-03');

查询所有数据

select * from test_partition_list;

查询某个分区的数据

select * from  test_partition_list_1_prt_p1;
select * from public.test_partition_list_1_prt_p1;


本文来源https://blog.csdn.net/qq_21383435/article/details/82023342

相关文章