我想知道这两个查询之间的区别:
1)
CREATE TABLE tblSample
(
T_Id INT PRIMARY KEY,
ID INT ,
BNO INT
)
2)
CREATE TABLE tblSample
(
T_Id INT,
ID INT,
BNO INT,
CONSTRAINT pk_id PRIMARY KEY(T_Id,ID,BNO)
)
答案 0 :(得分:2)
第一个不正确,你只能有一个主键。但是,每个表可以有多个唯一键。
对于第二个,您指定复合键,这意味着所有3个值的组合应该是唯一的,例如
* {
box-sizing: border-box;
}
body {
background: silver;
}
.box {
background-color: white;
height: 10em;
margin: 2em auto;
width: 10em;
}
.box:hover {
animation: border 1s linear forwards;
background-image: linear-gradient(to left, red, red), linear-gradient(to left, red, red), linear-gradient(to left, red, red), linear-gradient(to left, red, red);
background-position: top left, top right, bottom right, bottom left;
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}
@keyframes border {
0% {
background-size: 0% 4px, 4px 0%, 0% 4px, 4px 0%;
}
25% {
background-size: 100% 4px, 4px 0%, 0% 4px, 4px 0%;
}
50% {
background-size: 100% 4px, 4px 100%, 0% 4px, 4px 0%;
}
75% {
background-size: 100% 4px, 4px 100%, 100% 4px, 4px 0%;
}
100% {
background-size: 100% 4px, 4px 100%, 100% 4px, 4px 100%;
}
}
即使有2个第一列具有相同的值,也认为是有效值。