ERROR 1105 (HY000): A PRIMARY KEY must include all columns in the table ' s partitioning function

Source: Internet
Author: User

ERROR 1105 (HY000): A PRIMARY KEY must include all columns in the table ' s partitioning function


CREATE TABLE ' sample ' (
' ID ' bigint (a) not NULL auto_increment COMMENT ' primary key ',
' trade_no ' varchar (+) not NULL COMMENT ' xxx ',
' Trade_type ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Sub_trade_type ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' request_no ' varchar (+) not NULL COMMENT ' xxx ',
' request_date ' date not null DEFAULT ' 2000-01-01 ' COMMENT ' xxx ',
' Product_code ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Trade_channel ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Trade_status ' varchar (+) not NULL COMMENT ' xxx ',
' Revoke_flag ' varchar (8) DEFAULT NULL COMMENT ' xxx ',
' Cancel_flag ' varchar (8) DEFAULT NULL COMMENT ' xxx ',
' original_trade_no ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Trade_finished_date ' date DEFAULT NULL COMMENT ' xxx ',
' Pay_finish_date ' date DEFAULT NULL COMMENT ' xxx ',
' Ccy ' varchar (3) not NULL COMMENT ' xxx ',
' Trade_amt ' bigint (+) not NULL COMMENT ' xxx ',
' Discount_amt ' bigint (+) DEFAULT NULL COMMENT ' xxx ',
' Discount_info ' varchar (the DEFAULT NULL COMMENT ' xxx '),
' Pay_amt ' bigint (+) DEFAULT NULL COMMENT ' xxx ',
' Billing_contract_no ' bigint (a) NOT null DEFAULT 0 COMMENT ' xxx ',
' Billing_login_name ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' transfer_contract_no ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Transfer_login_name ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Transfer_flag ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' merchant_no ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' merchant_trade_no ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Merchant_name ' varchar (the DEFAULT NULL COMMENT ' xxx '),
' Goods_info ' varchar (+) DEFAULT NULL COMMENT ' xxx ',
' Memo ' varchar ($) DEFAULT NULL COMMENT ' xxx ',
' Created_at ' date not NULL COMMENT ' xxx ',
' created_by ' varchar (+) not NULL COMMENT ' xxx ',
' Updated_at ' date not NULL COMMENT ' xxx ',
' updated_by ' varchar (+) not NULL COMMENT ' xxx ',
PRIMARY KEY (id,request_date)
) Engine=innodb auto_increment=5731 DEFAULT charset=utf8 comment= ' xxx '
Partition by Range (year (request_date) *100+month (request_date)) (
Partition p201604 values less than (201604),
Partition p201605 values less than (201605),
Partition p201606 values less than (201606),
Partition p201607 values less than (201607),
Partition p201608 values less than (201608),
Partition p201609 values less than (201609),
Partition p201610 values less than (201610),
Partition p201611 values less than (201611),
Partition p201612 values less than (201612),
Partition p201701 values less than (201701),
Partition p201702 values less than (201702),
Partition p201703 values less than (201703),
Partition p201704 values less than (201704),
Partition p201705 values less than (201705),
Partition p201706 values less than (201706),
Partition p201707 values less than (201707),
Partition p201708 values less than (201708),
Partition p201709 values less than (201709),
Partition p201710 values less than (201710),
Partition p201711 values less than (201711),
Partition p201712 values less than (201712),
Partition p201801 values less than (201801),
Partition p201802 values less than (201802),
Partition p201803 values less than (201803),
Partition p201804 values less than (201804),
Partition p201805 values less than (201805),
Partition p201806 values less than (201806),
Partition p201807 values less than (201807),
Partition p201808 values less than (201808),
Partition p201809 values less than (201809),
Partition p201810 values less than (201810),
Partition p201811 values less than (201811),
Partition p201812 values less than (201812));

ERROR 1105 (HY000): A PRIMARY KEY must include all columns in the table ' s partitioning function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.