SagarPPanchal
SagarPPanchal

Reputation: 10131

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.

Is this possible, with PHP script or from MySQL console or whatever?

Upvotes: 1

Views: 289

Answers (2)

Ronak Shah
Ronak Shah

Reputation: 1549

You can use MYSQL workbench to export the record

1) for Null value record only

select * from tablename where col is null

2) your criteria

select * from tablename where your <criteria logic>

You can export this result set from workbench to csv or excel

You can also use TOAD for MYSQL

refer How to export table data in MySql Workbench to csv?

Upvotes: 1

Michael Legart
Michael Legart

Reputation: 820

You can use mysqldump to do it. It allows you to specify databaee and table and the --where parameter allows you to specify a where-clause.

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

Upvotes: 1

Related Questions