且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将MYSQL表导出到CSV时如何处理空字段

更新时间:2023-01-31 09:49:55

从MySQL 文档


如果FIELDS ESCAPED BY字符为空,则不会转义任何字符
,并且NULL输出为NULL,而不是\N。指定一个空的转义字符,
可能不是一个好主意,特别是如果数据中的字段值包含刚刚给出的列表中的任何字符。

If the FIELDS ESCAPED BY character is empty, no characters are escaped and NULL is output as NULL, not \N. It is probably not a good idea to specify an empty escape character, particularly if field values in your data contain any of the characters in the list just given.