Answers:
使用复合主键:
CREATE TABLE yourtable
(
employeeid INT,
blahblah VARCHAR(255),
blahblah2 VARCHAR(255),
recordmonth DATE,
recodrdyear DATE,
PRIMARY KEY (employeeid, recordmonth, recodrdyear)
)
如果表已经存在,则删除旧的主键:
ALTER TABLE yourtable
DROP PRIMARY KEY;
并重新创建它:
ALTER TABLE yourtable
ADD PRIMARY KEY (employeeid, recordmonth, recodrdyear);