如何批量将数据导出为csv [英] How do I export data as csv in batches
问题描述
你好,
我有一个包含约300万条记录的表.它包含下载了我的组织的免费电子书(messemgerangel.net)的人员的记录.我想细分数据以吸引他们并跟进.我想在csv中导出数据.但是,如果csv超过aprox,则不会完全打开该文件. 1百万条记录.
请问我如何批量导出100万条记录.
谢谢.
我尝试过的sql查询是有效的,但没有用:
Hello,
I have a table that contains about 3 million records. It contains the records of people who have downloaded my organization free ebook (messemgerangel.net). I want to segment the data for engaging them and follow up. I want to export the data in csv. But csv won''t open completely the file if it exceeds aprox. 1 million records.
Please how do i export the records in batches of 1 million.
Thank you.
The sql query i tried was, but it didn''t work:
SELECT `email`
FROM `filedownloads`
WHERE `email` LIKE '%@yahoo.%'
推荐答案
为什么不使用LIMIT
,例如
Why not useLIMIT
, for example
SELECT email FROM filedownloads LIMIT 0, 999999;
SELECT email FROM filedownloads LIMIT 1000000, 1999999;
SELECT email FROM filedownloads LIMIT 2000000, 2999999;
...
有关更多信息,请参见 13.2.9 SELECT语法 [
For more info, see 13.2.9 SELECT Syntax[^]
这篇关于如何批量将数据导出为csv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!