Two column as a primary keys in mysql?

前端 未结 8 1716
孤独总比滥情好
孤独总比滥情好 2020-12-15 06:34

Today I found out you can have a primary key using two columns (tsql). The PK must be unique but both columns do not (the combo must be unique).

I thought that was v

8条回答
  •  佛祖请我去吃肉
    2020-12-15 06:36

    Also one thing to note: Primary keys are automatically indexed in MySQL. And order of columns you mention in primary key does matter for performance as mentioned here

提交回复
热议问题