CREATE TABLE tbFac (
Fac_ID char(1) NOT NULL auto_increment,
Register_ID nchar(10) NOT NULL,
Fac_Name varchar(50) NOT NULL,
Branch 1 varchar(50) NOT NULL,
Branch 2 varchar(50) NOT NULL,
Branch 3 varchar(50) NOT NULL,
Branch 4 varchar(50) NOT NULL,
Branch 5 varchar(50) NOT NULL,
Branch 6 varchar(50) NOT NULL,
Branch 7 varchar(50) NOT NULL,
Branch 8 varchar(50) NOT NULL,
Status char(1) NOT NULL,
Note varchar(50) NOT NULL,
PRIMARY KEY (Fac_ID)
);
INSERT INTO tbFac VALUES ( '1', '5501990000', 'xxxxxxxx', 'xxxxx/1', 'xxxxx/2', 'xxxxx/3', 'xxxxx/4', 'xxxxx/5', 'xxxxx/6', 'xxxxx/7', 'xxxxx/8', '0', 'xxxxx');
INSERT INTO tbFac VALUES ( '2', '5501990001', 'xxxxxxxx', 'xxxxx/1', 'xxxxx/2', 'xxxxx/3', 'xxxxx/4', 'xxxxx/5', 'xxxxx/6', 'xxxxx/7', 'xxxxx/8', '0', 'xxxxx');
INSERT INTO tbFac VALUES ( '3', '5501990002, 'xxxxxxxx', 'xxxxx/1', 'xxxxx/2', 'xxxxx/3', 'xxxxx/4', 'xxxxx/5', 'xxxxx/6', 'xxxxx/7', 'xxxxx/8', '0', 'xxxxx');
INSERT INTO tbFac VALUES ( '4', '5501990003', 'xxxxxxxx', 'xxxxx/1', 'xxxxx/2', 'xxxxx/3', 'xxxxx/4', 'xxxxx/5', 'xxxxx/6', 'xxxxx/7', 'xxxxx/8', '0', 'xxxxx');
INSERT INTO tbFac VALUES ( '5', '5501990004', 'xxxxxxxx', 'xxxxx/1', 'xxxxx/2', 'xxxxx/3', 'xxxxx/4', 'xxxxx/5', 'xxxxx/6', 'xxxxx/7', 'xxxxx/8', '0', 'xxxxx');
และผลจากการกดปุ่ม "ลงมือ" จะออกมาเป็นแบบนี้ครับ
ผิดพลาด คำค้น SQL:
CREATE TABLE tbFac(
Fac_ID int( 11 ) NOT NULL AUTO_INCREMENT ,
Register_IDchar( 10 ) NOT NULL ,
Fac_Name varchar( 50 ) NOT NULL ,
Branch1varchar( 50 ) NOT NULL ,
Branch2varchar( 50 ) NOT NULL ,
Branch3varchar( 50 ) NOT NULL ,
Branch4varchar( 50 ) NOT NULL ,
Branch5varchar( 50 ) NOT NULL ,
Branch6varchar( 50 ) NOT NULL ,
Branch7varchar( 50 ) NOT NULL ,
Branch8varchar( 50 ) NOT NULL ,
STATUS char( 1 ) NOT NULL ,
Note varchar( 50 ) NOT NULL ,
PRIMARY KEY ( Fac_ID )
);
Code
MySQL แสดง: เอกสารอ้างอิง
#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 '1 varchar(50) NOT NULL,
Branch 2 varchar(50) NOT NULL,
Branch 3 varchar(50) NO' at line 5