ERROR 1075: Incorrect table definition; there can be only one auto column and it must be defined as a key

前端 未结 2 524
刺人心
刺人心 2021-01-28 03:32

I try to \"alter Table\" I need one more AI field, not key... \"List\"

ID INT(11):PK Not Null AutoIn..
Name VARCHAR
UserID INT(11):FK Not Null
edit BOOL
         


        
2条回答
  •  一个人的身影
    2021-01-28 04:08

    Based on your comments, you are confusing user interface with table data. The table only needs to have one ID, if you want you can create a query like this:

    SELECT ID, ID AS SORTPOS, NAME FROM List
    

    But you don't even need a query for that, you should do it only at user interface level.

    Plus, what you show in your comment is merely the heading of a list, not the list itself.

提交回复
热议问题