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

  • Home
  • SEARCH
  • 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 8782493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:34:26+00:00 2026-06-13T20:34:26+00:00

Is Partition BY RANGE can’t be applied for the table which has auto incremented

  • 0

Is Partition BY RANGE can’t be applied for the table which has auto incremented primary keys?
I’m asking it because saw some (1,2) examples of create table statement which doesn’t have primary key definition. And also my create table statement gives me error:

A PRIMARY KEY must include all columns in the table’s partitioning function

Here is my statement

CREATE TABLE `tbl_point` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `cord_x` double DEFAULT NULL,
   `cord_y` double DEFAULT NULL,
   `angle` int DEFAULT NULL,
   PRIMARY KEY (`id`)
)
PARTITION BY RANGE (angle) (
   PARTITION p0 VALUES LESS THAN (91),
   PARTITION p1 VALUES LESS THAN (181),
   PARTITION p2 VALUES LESS THAN (271),
   PARTITION p3 VALUES LESS THAN (361)
) 

And one more question: could angle column be of double type? Because I’ve got this error when I set it as double:

The PARTITION function returns the wrong type

Thanks.

  • 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-06-13T20:34:27+00:00Added an answer on June 13, 2026 at 8:34 pm

    The first error message is fairly explicit :

    A PRIMARY KEY must include all columns in the table’s partitioning function

    You must either partition by your primary key, or include angle in your primary key

    I suppose you do not want the latter, so the former is the solution.

    As for the second error:

    The PARTITION function returns the wrong type

    Indeed, the partition function (here, “angle” is the so-called “function”, think of it as the identity function) must return an integer, as stated in the manual:

    A partitioning key must be either an integer column or an expression that resolves to an integer.

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

Sidebar

Related Questions

How can I partition by range for: one for pubdate values less than Jan
I can in my situation either partition by range or by list for my
How to find the partition in which windows is installed using java or c#?
The following CREATE TABLE statement to partition a table works as expected, without error.
can someone tell me why the following behavior occurs (Oracle 10.2): SQL> create table
I have a large (150m+ row) table, which is partitioned into quarters using a
Here is my Create tabled and partition query: How can I insert Data into
How can I restore a partitioned mysql InnoDB table from just the .ibd files
Is it possible to partition a table using 2 columns instead of only 1
I have a very large table with a fulltext indexed column. If I partition

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.