gpt4 book ai didi

mySQL TSV infile 重复条目

转载 作者:行者123 更新时间:2023-11-29 14:11:56 25 4
gpt4 key购买 nike

一般来说,mySQL 脚本是新手。

使用 infile 将自动生成的 tsv 文件上传到本地 mySQL 服务器。 Windows Scheduler 运行启动文件内上传的批处理文件。

问题是每次批处理文件在文件进程中运行时,表中的条目都会重复。

有没有办法让它们追加而不是简单地写入?我是否需要条目的 key 才能识别条目?

感谢所有帮助。提前致谢。

最佳答案

Once you have defined some identifying key and specified it as such in MySQL (i.e. specified it as your PRIMARY KEY or else defined a UNIQUE KEY constraint), then you can use the REPLACE or IGNORE keywords (as appropriate) to your LOAD DATA command. – eggyal 27 mins ago

有关此过程语法的信息位于 here .

感谢 Eggyal 的帮助。

关于mySQL TSV infile 重复条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13366176/

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