gpt4 book ai didi

mysql - 插入 SQL 数据库?

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

我知道这听起来像是一个非常基本的问题,但我已经做 SQl 有一段时间了,只遇到过一次,这让我大吃一惊。

我有一个名为 Stud 的数据库,有 6 列。

sid     , firstname,lastname   ,title,dob     , gender
"124084","Bobby" ,"Carpenter","Mr" ,"040774","m"
"129002","Robin" ,"Hart" ,"Ms" ,"160275","f"
"129275","Julia" ,"Foster" ,"Ms" ,"080575","f"

我正在尝试将其插入螺柱中,但我得到了

您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解要在附近使用的正确语法

 INSERT INTO stud ( "123969","Heather","Howard","Ms","111274","f"
"124084","Bobby","Carpenter","Mr","040774","m"
"129002","Robin","Hart","Ms","160275","f"

这是因为数据在性别部分或之后没有额外的逗号吗?

很抱歉问了这样一个菜鸟问题,但这只是其中的一天。

最佳答案

您需要识别行

INSERT INTO stud (sid, firstname, lastname, title, dob, gender)   
values ("123969","Heather","Howard","Ms","111274","f")
, ("124084","Bobby","Carpenter","Mr","040774","m")
, ("129002","Robin","Hart","Ms","160275","f")

关于mysql - 插入 SQL 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33845964/

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