0

我在 db2 中有一个表(使用 bigsql),它按照 IBM BigInsights 上的日期进行分区

table_name_abc
   20150810
      data corresponding to partition
   20150811
      data corresponding to partition
   ....

我想要的是删除特定分区说20150810或从该分区中删除数据

我试过这个

db2 "truncate table test_schema.table_name_abc where partition_date = 20150810";

但它给出了以下错误

DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "where" was found following "test_table".
Expected tokens may include:  "".  SQLSTATE=42601

有人可以指导如何做到这一点吗?

4

1 回答 1

1

通过使用以下命令解决它

db2 "ALTER TABLE test_schema.table_name_abc DROP PARTITION (partition_date = 20150515)";

将其添加为答案以防万一有人需要它

于 2015-08-25T05:48:33.833 回答