Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7540527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:40:01+00:00 2026-05-30T07:40:01+00:00

How can I partition by range for: one for pubdate values less than Jan

  • 0

How can I partition by range for: one for pubdate values less than Jan 1, 2000; one for pubdate values greater than or equal to Jan 1, 2000 and less than Jan 1, 2010; and a third partition for all pubdate values greater than or equal to Jan 1, 2010.

How can I write my query for the partition part? I’ve tried to look up examples, but I just don’t understand what to put after partition.

My query is here:

CREATE table lab6_zl (
ID number not null, 
title varchar2(40), 
pubID char(3), 
pubdate date,
constraint lab6_pk primary key(ID))
Partition by range (pubdate)
(Partition one for pubdate values greater than or equal to Jan 1, 2000),
(Partition two for for pubdate values less than Jan 1, 2000),
(Partition three for all pubdate values greater than or equal to Jan 1, 2010);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:40:03+00:00Added an answer on May 30, 2026 at 7:40 am

    Try this:

    create table LAB6_ZL
    (
      ID        number not null
     ,TITLE     varchar2(40)
     ,PUBID     char(3)
     ,PUBDATE   date
     ,constraint LAB6_PK primary key(ID)
    )
    partition by range (PUBDATE)
      (partition TWO
         values less than (date '2000-01-01')
      ,partition ONE
         values less than (date '2010-01-01')
      ,partition THREE
         values less than (MAXVALUE));
    

    The order of the partitions must be ascending so partition TWO is created first as it is less than the year 2000 while ONE is therefore between 2000 and 2009. The keyword MAXVALUE basically means no upper value, or, anything on or after 1st January 2010.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I specify in a range that all rows having value in CreatedDate column
Given a positive integer X , how can one partition it into N parts,
Here is my Create tabled and partition query: How can I insert Data into
On my 64-bit Debian/Lenny system (4GByte RAM + 4GByte swap partition) I can successfully
Can you partition a table in SQL with SQL 2008 or SQL 2008 R2?
Can anybody explain about the SQL Range and List partitions with an example? i
Given an integer n and a positive real number s, how can I partition
How can i get the start and end sectors of the partitions of my
Can somebody point me to a resource that explains how to go about having
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.