My MySQL database has tables which contain the column company_id and other tables don't, and I want to dump all the data into a SQL file.
But I need to add a where company_id=1 only for the tables that have this column, and for the rest I need to get all the data.
This is not working for me because I have to specify the table name, and what I need is to dump everything with a the condition on every table that has that column :
mysqldump -u root -p root databaseName tableName --where company_id=1 > mydb_tables.sql