Mysql table partition based on last digit of a column/id

后端 未结 2 1973
难免孤独
难免孤独 2021-01-22 03:37

I want to create partitions based on last digit of employee id, i.e

all ids ending with 0 go to first partition,

ending with 1 go to seco         


        
2条回答
  •  半阙折子戏
    2021-01-22 04:21

    You will not be able to partition based on the last digit of the EmployeeID, as that would mean that you need to use substring function to retrieve the last digit first, which you can't do, due to limitations on the functions which can be used in partitioning clause.

    MySQL allows a definite list of functions, starting with version 5.1.12, which are listed here.

提交回复
热议问题