电子邮件列表,从表中删除行
如果我在 .txt 文件中有电子邮件帐户列表,有没有办法可以针对表中包含电子邮件帐户的行的每个实例执行 mysql 删除语句?
我们有一个时事通讯邮件列表,其中大约有 600 封电子邮件目前无效,我们希望有一种更简单的方法来删除它们,除了手动逐一删除之外。
If I have a list of of email accounts in a .txt file, is there a way I can perform a mysql delete statement for each instance of the rows that contain the email account against a table?
We have a newsletter mailing list which around 600 emails are currently invalid, and we want an easier way of getting rid of them besides manually going in one by one to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 Excel 将数据集转换为逗号分隔的字符串,然后简单地:
请注意,您还需要在 Excel 中的每个电子邮件地址之前和之后手动添加单引号。
Use excel to turn the dataset into a comma separated string and then simply:
Note that you will need to manually add the single quotes before and after each email address in excel as well.
假设您想使用文本文件的内容作为要从数据库中删除的地址源:
是最简单的形式。您可以采取一些措施来优化流程,例如以引号/逗号分隔的形式创建电子邮件列表,并使用
WHERE IN (...)
代替,以减少生成的查询数量/被执行。请注意,我使用 PHP 作为伪代码占位符,但基本原理在几乎任何语言中都是相同的。
Assuming you want to use the text file's contents as the source of addresses to delete from the database:
is the simplest form. You can do some things to optimize the process, such as creating a list of emails in quoted/comma-separated form and using
WHERE IN (...)
instead, to reduce the number of queries generated/executed.Note that I'm using PHP as a pseudo-code placeholder, but the basic principle would be the same in pretty much any language.
为
单个电子邮件
创建删除语句
然后使用Microsoft Excel
完成其余电子邮件怎么样?通过使用连接功能并与所选电子邮件列表进行匹配What about create the
delete statement
forsingle email
then useMicrosoft excel
to complete the rest of the emails? by using the concatenate function and matching with the list of the selected emails