![]() |
|
![]() |
![]() |
Archives of the TeradataForumMessage Posted: Fri, 06 May 2005 @ 13:18:31 GMT
> Dcpbl VARCHAR( 6 ) NULL , >... > PARTITION BY CASE_N > ( > Dcpbl < 200002 > , Dcpbl < 200003 Every time a row is inserted, or some other partitioning operation is done, this definition will require Dcpbl to be converted from varchar to integer. This is not good! Let's assume that Dcpbl is a year-month combination and that 2000 is the lowest year needed. Then Dcpbl should be redefined as an integer, and the partitioning expression can be recoded like this: PARTITION BY (((Dcpbl / 100) - 2000) * 12) + (Dcpbl MOD 100) This will produce sequential month numbers from 1 (=Jan. 2000) to N -- more than 5000 years' worth.
| ||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||