蔭收到錯誤1064 SQL錯誤CREATE TABLE語句中
#1064 - 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 ''ID' int, 'MGR_ID' int, 'DEPT_ID' int, 'NAME' VARCHAR2(30), 'SAL' int, ' at line 3 while creating a table. I have already a table department with PK as 'dept_id'. Help lease
CREATE TABLE emp
(
'ID' int,
'MGR_ID' int,
'DEPT_ID' int,
'NAME' VARCHAR2(30),
'SAL' int,
'DOJ' DATE,
PRIMARY KEY ('ID') ,
FOREIGN KEY ('MGR_ID') REFERENCES emp('ID') ,
FOREIGN KEY ('DEPT_ID') REFERENCES department('dept_id')
)
我用這一個,但不工作 – justjiten
'Varchar2'不會在MySQL中工作。將其更改爲「Varchar」。 –
耶謝謝,工作正常。 – justjiten