Mysqldump multiple tables with where clauses in single transaction Suppose, we have 2 tables: t1,t2 in database db:
Expected the below code to dump tables based on conditions specified in the where clauses:

mysqldump --login-path=login_path \
    --single-transaction db t1 \
    --where="user_id&gt;200" , t2 --where="id&gt;200" &gt; /tmp/users_data.sql


However the following error is popped:


  mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM t1
  WHERE id>200 Unknown column 'id' in 'where clause' (1054)


How to dump multiple tables with where clauses  using mysqldump correctly? If it's not possible, is there a workaround?
MySQL dump has only a single where clause which makes the use hard in two tables like you do.

One way would be in t1, create a generated column called id that is effectively user_id. 

ALTER TABLE t1
ADD id UNSIGNED INT GENERATED ALWAYS AS (user_id),
ADD INDEX id_key ( id)


Adjust type to match the type of user_id.

ref: https://dev.mysql.com/doc/refman/5.7/en/create-table-secondary-indexes.html