我的是mysql5.7.请看下有什么错,错误出在varchar(20)这一行
如上图所示。
mysql> CREATE TABLE tb1(
-> age TINYINT UNSIGNED,
-> salary FLOAT(8,2) UNSIGNED
-> );
这是可以的,但是
mysql> CREATE TABLE tb1(
-> username VARCHAR(20),
-> age TINYINT UNSIGNED,
-> salary FLOAT(8,2) UNSIGNED
-> );
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 '(20),
age TINYINT UNSIGNED,
salary FLOAT(8,2) UNSIGNED
)' at line 2
这就不行
mysql> CREATE TABLE tb2(
-> username VARCHAR(20)
-> );
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 '(20)
)' at line 2
这也不行,谁能帮我看下错误在哪?