Ask the Expert

Is there an "equal" syntax when creating a partitioned table?

I have one question for you about Oracle partitioned tables. Is there an "equal" syntax when creating a partitioned table? For example, I created the below table as t_cemal:
 
 CREATE TABLE t_cemal
 (t_no            NUMBER NOT NULL,
  t_date          DATE   NOT NULL,
  t_comments      VARCHAR2(100))
 PARTITION BY RANGE (t_no)
 (PARTITION t_no4 VALUES LESS THAN (5) );
 
But I want:
 PARTITION BY RANGE (t_no)
 (PARTITION t_no4 VALUES EQUAL 5);
What is correct syntax?

    Requires Free Membership to View

Why not create two partitions? The first partition will have all values less than 5. The second partition will have all values less than 6. This second parition can only contain the value five since all values less than five will be in the other partition.

Alternatively, you can look at List Partitioning. With list partitioning, you can have the first partition contains the values "1,2,3,4" and the second partition contain the values "5".

This was first published in May 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: