【发布时间】:2015-09-10 09:48:42
【问题描述】:
我想在mysql中创建一个表:--
create table app_own(app_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
sp_id bigint(20),
title varchar(30),
description varchar(60),
details LONGTEXT(1000),
primary key(app_id ),
FOREIGN KEY (user_id) REFERENCES student(sp_id));
其中 app_id 是主键,sp_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 '(1000)0,primary key(app_id ),FOREIGN KEY (sp_id)
REFERENCE' at line 1
为什么会出现错误?
【问题讨论】:
标签: mysql database create-table