Two column as a primary keys in mysql?

前端 未结 8 1718
孤独总比滥情好
孤独总比滥情好 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 07:03

    You are over thinking this:

    • primary keys (no matter how many columns are involved) must be unique
    • your primary key is the two columns a, b

    Therefore a and b together must be unique.

    Individual value of a and b are irrelevant.

提交回复
热议问题