創建外鍵怎么老是提示這個錯誤呀 我感覺我代碼沒敲錯啊
mysql> CREATE TABLE users(
??? -> id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
??? -> username VARCHAR(10) NOT NULL,
??? -> pid SMALLINT UNSIGNED,
??? -> POREIGN KEY (pid) REFERENCES provinces (id)
??? -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'KEY (pid) REFERENCES provinces (id)
)' at line 5
mysql>
2017-10-16
佩服佩服
2017-09-23
已解決?? 原來是FOREIGN? 我寫成了P```哎?