谁能在SQL语法中找到错误错误 [英] Can anyone find the error error in sql syntax

查看:88
本文介绍了谁能在SQL语法中找到错误错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我这段代码有什么问题吗

Can someone tell me what wrong with this code

epay_area_list

CREATE TABLE epay_area_list(
   id tinyint( 3 ) unsigned NOT NULL AUTO_INCREMENT ,
   titlechar( 30 ) NOT NULL default '',
   parent tinyint( 4 ) NOT NULL default '0',
   akey bigint( 20 ) NOT NULL default '0',
   PRIMARY KEY ( id )
) TYPE = 'MyISAM';

MySQL说:


文档#1064-您的SQL语法有错误;检查与您的MySQL服务器版本相对应的
手册,以在第23行的'TYPE ='MyISAM'附近使用正确的
语法

Documentation #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 'TYPE='MyISAM'' at line 23

不胜感激

推荐答案

您错过了 title 及其数据类型 char(30)

You're missing a space between title and its datatype char( 30 ):

CREATE TABLE IF NOT EXISTS epay_area_list (
   id tinyint( 3 ) unsigned NOT NULL AUTO_INCREMENT ,
   title char( 30 ) NOT NULL default '', -- ADDED SPACE HERE
   parent tinyint( 4 ) NOT NULL default '0',
   akey bigint( 20 ) NOT NULL default '0',
   PRIMARY KEY ( id )
) TYPE = 'MyISAM';

这篇关于谁能在SQL语法中找到错误错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆