CREATE TABLE orders (
cust_id int(5) NOT NULL,
order_id int(5) NOT NULL,
date timestamp(12),
instructions varchar(128),
creditcard char(16),
expirydate char(5),
PRIMARY KEY (cust_id,order_id)
) type=MyISAM ;发生错误:
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 '(12),instructions varchar(128),
creditcard char(16),
expirydate char(5),
PRIMAR' at line 4
------------------------------------------------------------------------------------------
说实话,没看出哪里错了,小弟新手一个,书上用MySQL 4.4通过了,小弟的5.5没通过,咋回事?
另外,是不是MySQL5.5不允许加入type=MyISAM?小弟的很多语句加入它都错了,尚不明白为什么,不过在这里我去掉type=MyISAM也没用啊?
cust_id int(5) NOT NULL,
order_id int(5) NOT NULL,
date timestamp(12),
instructions varchar(128),
creditcard char(16),
expirydate char(5),
PRIMARY KEY (cust_id,order_id)
) type=MyISAM ;发生错误:
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 '(12),instructions varchar(128),
creditcard char(16),
expirydate char(5),
PRIMAR' at line 4
------------------------------------------------------------------------------------------
说实话,没看出哪里错了,小弟新手一个,书上用MySQL 4.4通过了,小弟的5.5没通过,咋回事?
另外,是不是MySQL5.5不允许加入type=MyISAM?小弟的很多语句加入它都错了,尚不明白为什么,不过在这里我去掉type=MyISAM也没用啊?
解决方案 »
- 请教一个SQL语句,急,多谢
- mysql binlog 查找
- 求个SQL语句!
- 如何查询前10条记录
- 一道面试题,帮看一下,谢谢
- 下载了个mysql5的非安装版,不知怎么运行起来?
- MySQL/Postgresql是开放源代码的吗?在哪儿可以下载到他们的源代码?可以对他们的源代码进行修改吗?
- Invalid authorization specification: Access denied for user: '[email protected]' (Using password: YES)
- 求Sql语句
- mysql 里面的自增组件(auto_increment)在源码中是如何实现的
- 请问一下这样的sql目的能否实现
- 快速删除重复记录
cust_id int(5) NOT NULL,
order_id int(5) NOT NULL,
`date` timestamp,
instructions varchar(128),
creditcard char(16),
expirydate char(5),
PRIMARY KEY (cust_id,order_id)
) type=MyISAM ;
建议看一下MYSQL的免费手册中的说明。
因为你没有注意到 timestamp(12), 改成 timestamp,
1. 仔细
2. 多看MYSQL文档
3. 实践