Oracle: Partition table by month

前端 未结 2 1570
没有蜡笔的小新
没有蜡笔的小新 2021-01-26 13:19

My solution(months in german):

PARTITION BY LIST ((to_char(GEBURTSDATUM, \'Month\'))) 
(  
  PARTITION p1 VALUES(\'JANUAR\'),  
  PARTITION p2 VALUES(\'Februar\'         


        
2条回答
  •  梦毁少年i
    2021-01-26 13:55

    In 11g you can use function-based partitioning through defining a virtual column: http://www.oracle-base.com/articles/11g/partitioning-enhancements-11gr1.php#virtual_column_based_partitioning

    Otherwise, you must manually define and maintain a separate column for the partitioning month.

    I'd suggest using month numbers instead of names in either case.

提交回复
热议问题