CREATE TABLE trade (
tradeid int NOT NULL PRIMARY KEY identity(17,1),
userid int NOT NULL,
tradetime datetime NOT NULL,
KEY "user_id_fk" ("userid"),
CONSTRAINT "user_id_fk" FOREIGN KEY ("userid") REFERENCES "userinfo" ("userid")
)
不知道怎麼傳圖片,前面的我改過來了,還有後面兩句的報錯,倒數第二句“key”"userid",倒數第一句是"userid" "userid"
謝謝了,對數據庫不太懂
CREATE TABLE trade (
tradeid int NOT NULL PRIMARY KEY identity(17,1),
userid int NOT NULL,
tradetime datetime NOT NULL,
CONSTRAINT user_id_fk FOREIGN KEY (userid) REFERENCES userinfo(userid)
)