Hi: I have a datetime column in my table and I want to partition by quarter of every year for the next 5 years. The table and partitions seems to have created fine. Not sure if this will work since quarter function returns an integer without the year. Can someone comment?
CREATE TABLE STATUS (
id NUMERIC(16) NOT NULL,
FIRSTOCCURRENCE DATETIME NOT NULL,
PRIMARY KEY ( ID,FIRSTOCCURRENCE )
)
PARTITION BY RANGE (QUARTER(FIRSTOCCURRENCE))
(
PARTITION p2012_3 values less than (20123),
PARTITION p2012_4 values less than (20124),
PARTITION p2013_1 values less than (20131),
PARTITION p2013_2 values less than (20132),
PARTITION p2013_3 values less than (20133),
PARTITION p2013_4 values less than (20134),
PARTITION p2014_1 values less than (20141),
PARTITION p2014_2 values less than (20142),
PARTITION p2014_3 values less than (20143),
PARTITION p2014_4 values less than (20144),
PARTITION p2015_1 values less than (20151),
PARTITION p2015_2 values less than (20152),
PARTITION p2015_3 values less than (20153),
PARTITION p2015_4 values less than (20154),
PARTITION p2016_1 values less than (20161),
PARTITION p2016_2 values less than (20162),
PARTITION p2016_3 values less than (20163),
PARTITION p2016_4 values less than (20164),
PARTITION p2017_1 values less than (20171),
PARTITION p2017_2 values less than (20172),
PARTITION p2017_3 values less than (20173),
PARTITION p2017_4 values less than (20174),
PARTITION p2018_1 values less than (MAXVALUE)
);