0
CREATE TABLE IF NOT EXISTS customers (customer_id TEXT NOT NULL, time_stamp TIMESTAMP NOT NULL, customer_info TEXT), PRIMARY KEY (time_stamp)
SQL有什么问题?
的错误是
mysql> CREATE TABLE IF NOT EXISTS customers (customer_id TEXT NOT NULL, time_stamp TIMESTAMP NOT NULL,
customer_info TEXT), PRIMARY KEY (time_stamp);
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 ' PRIMARY KEY (time_stamp)' at line 1
你得到什么错误? – BoltClock 2010-11-25 02:06:35
是`PRIMARY KEY`之前的那个逗号吗?顺便说一下,时间戳对于客户来说似乎不是一个好PK。它不应该是'customer_id`吗? – Kos 2010-11-25 02:08:18