How can I partition by range for: one for pubdate values less than Jan 1, 2000; one for pubdate values greater than or equal to Jan 1, 2000 and less than Jan 1, 2010; and a third partition for all pubdate values greater than or equal to Jan 1, 2010.
How can I write my query for the partition part? I’ve tried to look up examples, but I just don’t understand what to put after partition.
My query is here:
CREATE table lab6_zl (
ID number not null,
title varchar2(40),
pubID char(3),
pubdate date,
constraint lab6_pk primary key(ID))
Partition by range (pubdate)
(Partition one for pubdate values greater than or equal to Jan 1, 2000),
(Partition two for for pubdate values less than Jan 1, 2000),
(Partition three for all pubdate values greater than or equal to Jan 1, 2010);
Try this:
The order of the partitions must be ascending so partition
TWOis created first as it is less than the year 2000 whileONEis therefore between 2000 and 2009. The keywordMAXVALUEbasically means no upper value, or, anything on or after 1st January 2010.