4

I have two tables:

table1 - columns: id, name table2 - columns: id_table2, id, creation_date 

Is it possible to execute mysqldump like this:

mysqldump --single-transaction -u<uname> -p<pass> <databasename> <table1> --where="id in (select id from table2 where creation_date>'2016-08-05')" <table2> --where="creation_date>'2016-08-18'" > D:\dump.sql 

Is there a syntax error because I get the following error:

mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `table1` WHERE creation_date>'2016-08-18'': Unknown column 'creation_date' in 'where clause' (1054) 
2
  • Maybe this related post could help you: stackoverflow.com/questions/935556/mysql-dump-by-query Commented Aug 18, 2016 at 13:38
  • @FragBis i want to dump 2 tables in one mysqldump execution and for each table i want only a selection using WHERE clause Commented Aug 18, 2016 at 13:44

1 Answer 1

0

Can you first create a "temporary table" with for example "SELECT * INTO temp1 FROM table1 WHERE ...etc." and then dump this temp1 table (and temp2 if you want) ?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.