0
我有兩個表多個表:的mysqldump與WHERE子句
table1 - columns: id, name
table2 - columns: id_table2, id, creation_date
是否可以這樣執行的mysqldump:
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
是否有語法錯誤,因爲我得到以下錯誤:
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)
也許這個相關的文章可以幫助你:http://stackoverflow.com/questions/935556/mysql-dump-by-query – FragBis
@FragBis我想轉儲2個表在一個mysqldump執行和每個表我只想要使用WHERE子句進行選擇 – laura