gpt4 book ai didi

mysql - #1064 - 你的 SQL 语法有错误;逗号不丢失

转载 作者:行者123 更新时间:2023-11-29 21:00:39 26 4
gpt4 key购买 nike

我收到以下错误:

#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 'CREATE TABLE IF NOT EXISTS `blog` (
`Blog_ID` int(11) NOT NULL,
`Blog_Name` va' at line 53

下面是我的代码,

CREATE TABLE IF NOT EXISTS `blog` (
`Blog_ID` int(11) NOT NULL,
`Blog_Name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`User_User_ID` int(11) NOT NULL,
`Blog_Url` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`Blog_Sort` tinyint(4) DEFAULT NULL,
`Blog_Parent` tinyint(4) NOT NULL DEFAULT '0',
`Blog_Status` tinyint(4) NOT NULL DEFAULT '0',
`Blog_Date` timestamp NULL DEFAULT NULL,
`Blog_Publish` datetime DEFAULT NULL,
`Blog_Content` mediumblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

我在 StackOverflow 上看到过类似的问题,他们的代码的问题是有一个额外的逗号。我的问题似乎有所不同。

编辑:下面是上面的代码,

--
-- Table structure for table `attendance_type`
--

CREATE TABLE IF NOT EXISTS `attendance_type` (
`Attendance_ID` int(11) NOT NULL,
`Attendance_Code` text,
`Attendance_Desc` text,
`Attendance_Meaning` varchar(45) DEFAULT NULL,
`Attendance_Action` text NOT NULL,
`Attendance_Action_Group` varchar(45) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `attendance_type`
--

INSERT INTO `attendance_type` (`Attendance_ID`, `Attendance_Code`, `Attendance_Desc`, `Attendance_Meaning`, `Attendance_Action`, `Attendance_Action_Group`) VALUES
(3, '#', 'School closed to pupils', 'Not counted in possible attendance', 'yes', '5'),
(4, '/', 'Present (a.m.)', 'Present', 'no', '1'),
(5, '\\', 'Present (p.m.)', 'Present', '', '1'),
(6, 'B', 'Educated Off Site (NOT Dual Registration)', 'Appoved Education Activity (Present)', 'yes', '2'),
(7, 'C', 'Other Authorised Circumstance (not covered by other appropriate code/description', 'Authorised Absence', 'yes', '4'),
(8, 'D', 'Dual Registration (ie pupil attending other establishment)', 'Not counted in possible attendance', '', '5'),
(9, 'E', 'Excluded (no alternative provision made)', 'Authorised Absence', 'yes', '4'),
(10, 'G', 'Family Holiday (NOT agreed or days in excess of agreement)', 'Unauthorised Absence', 'yes', '3'),
(11, 'H', 'Family Holiday (Agreed)', 'Authorised Absence', 'yes', '4'),
(12, 'I', 'Illness (NOT medical or dental etc. appointments)', 'Authorised Absence', 'yes', '4'),
(13, 'J', 'Interview', 'Appoved Education Activity (Present)', 'yes', '2'),
(14, 'L', 'Late (before registers closed)', 'Present', 'no', '1'),
(15, 'M', 'Medical/Dental appointments', 'Authorised Absence', 'yes', '4'),
(16, 'N', 'No reason yet provided for absence', 'Unauthorised Absence', 'yes', '3'),
(17, 'O', 'Unauthorised absence (not covered by any other code/description)', 'Unauthorised Absence', '', '3'),
(18, 'P', 'Approved Sporting Activity', 'Appoved Education Activity (Present)', 'yes', '2'),
(19, 'R', 'Religious Observance', 'Authorised Absence', 'yes', '4'),
(20, 'S', 'Study Leave', 'Authorised Absence', 'yes', '4'),
(21, 'T', 'Traveller Absence', 'Authorised Absence', 'yes', '4'),
(22, 'U', 'Late (After registers closed)', 'Unauthorised Absence', '', '3'),
(23, 'V', 'Educational Visit or Trip', 'Appoved Education Activity (Present)', 'yes', '2'),
(24, 'W', 'Work Experience', 'Appoved Education Activity (Present)', 'yes', '2'),
(25, 'X', 'Untimetabled sessions for non-compulsory school-aged pupils', 'Not counted in possible attendance', 'yes', '5'),
(26, 'Y', 'Enforced and partial enforced closure', 'Not counted in possible attendance', 'yes', '5'),
(27, 'Z', 'Pupil not yet on roll', 'Not counted in possible attendance', 'yes', '5');

-- --------------------------------------------------------

最佳答案

这很可能是由该查询之前的语法引起的,这里的代码很好。 See here:

关于mysql - #1064 - 你的 SQL 语法有错误;逗号不丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37256470/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com