Reputation: 10131
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
Reputation: 1549
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
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