Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
When I create a table using the following statement, I get an error.
CREATE TABLE HOTEL(ROOM_NUMBER, check_in_date, check_out_date)
Error:
Error Code: 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 ', check_in_date, check_out_date)' at line 1
What can I do to solve this?
you must have to define datatype like this:
CREATE TABLE HOTEL(
ROOM_NUMBER int,
check_in_date datetime,
check_out_date datetime
);
source
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Trying the below commands on MySQL 5.6 but getting syntax error.
INSERT INTO device
( uid, name, type, os, device_active,
screen_resolution, network_type,status)
VALUES ('1110b','XIAOMI','Android','Android 10',
false,'2340*1080','WIFI',1),
('A2QD1','HUAWEI','Android','Android 7.0',
true,'1920*1080','WIFI',1) As new
ON DUPLICATE KEY
UPDATE device_active = VALUES(new.device_active);
Error: 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 'As new ON DUPLICATE KEY UPDATE device_active = VALUES(new.device_active)'
NEW. values are only available in triggers VALUES(device_active) should be enough.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I get the below error:
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 '('text','text','text',1,2,3,4,5,6,7,' at line 4
when trying to run this SQL command:
insert into `table`
VALUES
(`col1`,`col2`,`col3`,`col4`,`col5`,`col6`,`col7`,`col8`,`col9`,`col10`,`col11`,`col12`,`col13`,`col14`)
('text','text','text',1,2,3,4,5,6,7,8,'text','text','text'),
('text','text','text',11,12,13,14,15,16,17,18,'text','text','text')
UPDATE: I'm a complete moron, added col names before VALUES...
insert into `table`
(`col1`,`col2`,`col3`,`col4`,`col5`,`col6`,`col7`,`col8`,`col9`,`col10`,`col11`,`col12`,`col13`,`col14`)
VALUES
('text','text','text',1,2,3,4,5,6,7,8,'text','text','text'),
('text','text','text',11,12,13,14,15,16,17,18,'text','text','text')
insert into `table`(`col1`,`col2`,`col3`,`col4`,`col5`,`col6`,`col7`,`col8`,`col9`,`col10`,`col11`,`col12`,`col13`,`col14`)
VALUES('text','text','text',1,2,3,4,5,6,7,8,'text','text','text'),
('text','text','text',11,12,13,14,15,16,17,18,'text','text','text')
insert into `table`
(`col1`,`col2`,`col3`,`col4`,`col5`,`col6`,`col7`,`col8`,`col9`,`col10`,`col11`,`col12`,`col13`,`col14`)
VALUES
('text','text','text',1,2,3,4,5,6,7,8,'text','text','text')
,
('text','text','text',11,12,13,14,15,16,17,18,'text','text','text')
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
i created a database for a nfl team. I created a table called players that holds bios info. Now i want to create a table called transactions that shows the trade transactions but players to the active roster based from the primary key of players. But i keep getting this error: 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 'KEY(idplayer) REFERENCES players(playersid))' at line 8.
`
create table transactions(
transid INT UNSIGNED NOT NULL AUTO_INCREMENT,
type VARCHAR(30),
fromteam VARCHAR(30),
toteam VARCHAR(30),
idplayer INT UNSIGNED NOT NULL,
PRIMARY KEY(transid),
FORIEGN KEY(idplayer) REFERENCES players(playersid));
Please could someone help me out on similar experiences.
I think you just misspelled FOREIGN :-)
Typo, change
FORIEGN KEY(idplayer) REFERENCES players(playersid));
to
FOREIGN KEY(idplayer) REFERENCES players(playersid));