简体   繁体   English

导出MySQL表,其中行值仅包含NULL值

[英]Export MySQL table in which row values contains only NULL value

In want to export MySQL table which contains 1M+ records, now I want to figured out those records which is having NULL values and also export those values only which satisfy my criteria. 在要导出包含1M +记录的MySQL表中,现在我想找出那些具有NULL值的记录,并仅导出那些满足我的条件的值。

Is this possible, with PHP script or from MySQL console or whatever? 使用PHP脚本或从MySQL控制台或任何其他方式有可能吗?

You can use mysqldump to do it. 您可以使用mysqldump做到这一点。 It allows you to specify databaee and table and the --where parameter allows you to specify a where-clause. 它允许您指定databaee和table,而--where参数允许您指定where子句。

See https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html 参见https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html

You can use MYSQL workbench to export the record 您可以使用MYSQL工作台导出记录

1) for Null value record only 1)仅用于空值记录

select * from tablename where col is null

2) your criteria 2)您的标准

select * from tablename where your <criteria logic>

You can export this result set from workbench to csv or excel 您可以将此结果集从工作台导出到csv或excel

You can also use TOAD for MYSQL 您也可以将TOAD用于MYSQL

refer How to export table data in MySql Workbench to csv? 请参阅如何将MySql Workbench中的表数据导出到csv?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM