Home » SQL & PL/SQL » SQL & PL/SQL » MONTHWISE PARTITION OF TABLE
MONTHWISE PARTITION OF TABLE [message #20528] Sat, 01 June 2002 05:57 Go to next message
BABU SRSB
Messages: 42
Registered: June 2002
Member
Hi,
i need the partition of the table in month wise. i don't bother about the the year and date. i need the partion of the table in monthwise. all january transactions should in one partition and all february transactions should in one partition like wise the remaining months. i am giving sample table structure in below. can any one suggest me.
CREATE TABLE tb_test
(
LOGIN varchar2(6) NOT NULL,
TRANSACTION VARCHAR2(4000),
TRANS_DATE DATE NOT NULL
)

waiting.......

Regards,

Babu
Re: MONTHWISE PARTITION OF TABLE [message #20537 is a reply to message #20528] Mon, 03 June 2002 08:04 Go to previous messageGo to next message
billh
Messages: 35
Registered: August 1999
Member
CREATE TABLE tb_test
(
LOGIN varchar2(6) NOT NULL,
TRANSACTION VARCHAR2(4000),
TRANS_DATE DATE NOT NULL
)
partition by range (trans_date)
(partition tb_jan values less than (to_date('01-FEB-2002', 'DD-MON-YYYY')) tablespace trans_jan,
(partition tb_feb values less than (to_date ('01-MAR-2002', 'DD-MON-YYYY')) tablespace trans_feb,
(partition tb_base values less than (maxvalue) tablespace trans_base ) ;

any transaction with a trans_date less than 1 Feb 2002 will go into the January partition, any transaction with a date less than 1 Mar 2002 will go into the February partition. This example places each partition in a separate tablespace. This is an option you can just as easily place all partitions in the same tablespace.
Re: MONTHWISE PARTITION OF TABLE [message #20742 is a reply to message #20537] Mon, 17 June 2002 06:52 Go to previous message
BABU SRSB
Messages: 42
Registered: June 2002
Member
Hai Billh,

Thanks for your reply and sorry for my late response. actually my problem is not for the particular date(like '01-FEB-2002'). Here i am giving the sample data. for the place convenence i am giving the date variable only.
1.)'01-JAN-01'
2.)'03-FEB-02'
3.)'02-JAN-02'
4.)'17-FEB-02'
5.)'24-OCT-02'
6.)'15-JAN-03'
7.)'02-FEB-03'
8.)'20-SEP-03'
9.)'12-AUG-01'

So, according to the above data 1, 3 and 6 should go the JANUARY partition. 2, 4 and 7 should go the FEBRUARY partition. and the remaining should go the other partition.
so, Please suggest me in ASAP.

Regards,

SRSB Babu
Previous Topic: Simple SQL Query.
Next Topic: Implicit and Explicit cursors
Goto Forum:
  


Current Time: Sat Oct 20 01:04:16 CDT 2018