gpt4 book ai didi

mysql - 为什么当我上传 csv 文件时,数据库中的某一列中的数字不断变化?

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

当我在数据库中导入 csv 文件时,它似乎总是完全更改 id 列中的数字。这可能是由于编码造成的吗? This is the link to my csv file. The column is stop_id

最佳答案

在您的问题和评论中,您谈到了 stop_id 列的数字。您是否有机会将该列定义为数字数据类型?

只有前 31 个 stop_id 是数字:

stop_id,stop_name,stop_lat,stop_lon
"700000000240","Belfast (Europa Bus Centre)","54.5945926369851","-5.93660082131046"
"700000003388","Sprucefield (Shopping Centre)","54.4872433773613","-6.06597923051899"
"700000003812","Newry (College of Further Education)","54.1768023042176","-6.34321285594727"

之后你得到字符串:

"810B137531","Cannistown School","53.6212628722786","-6.66677004511465"
"8210B1340201","Hacketstown (Kealys)","52.8652215308509","-6.55839857023041"
"8210B136211","Rathvilly (Opp Post Office)","52.8804440197479","-6.69566912436171"
"8210B136231","Hacketstown (Opp Kealys)","52.86533977541","-6.55851347138918"

然后你会得到这个:

"gen:31400:3017:1:2","Portadown (Danske Bank)","54.4229216097347","-6.44325546877619"
"gen:31400:4183:1:2","Rathfriland","54.2365511195376","-6.15840771694293"
"gen:31400:4183:1:3","Rathfriland","54.2365511195376","-6.15840771694293"

或者您是否将该列定义为文本,但太短?

一般来说,您的 csv 文件没问题。

关于mysql - 为什么当我上传 csv 文件时,数据库中的某一列中的数字不断变化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34642926/

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