Henry,

Maybe the shell is doing something funky with the parens?

maybe try escaping them with the \ ??


Just a wild guess :)

 

> -----Original Message-----
> From: Henry Dall [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 15, 2006 12:06 PM
> To: mysql@lists.mysql.com
> Subject: Problems getting MySqlDump to use sub-queries
> 
> I am having a problem using MySqlDump.  Context: I am having 
> to export some "very specific" records from our database
> 
>  
> 
> We have a table called BIN which has, amongst others, an ID 
> column and an ACCOUNT_ID column.  When I use this
> 
>  
> 
> mysqldump -u root -p --complete-insert 
> "--where=account_id='19444'" -t otm bin > 
> /otm/reports/datadump/mediaowner_bin.txt
> 
>  
> 
> it does properly create Insert statements matching the 
> results that the "where" clause should return.
> 
>  
> 
> However, we have another table called BIN_DATA which has ID 
> and BIN_ID columns (the BIN_ID being a link to the BIN table 
> mentioned above).  If I fire off the following query from 
> within MySql:
> 
>  
> 
>             select * from bin_data where bin_id in (select id 
> from bin where account_id=19444);
> 
>  
> 
> it works great, returning the rows I'd expect.  However, 
> where I am getting stuck is getting MySqlDump to handle this 
> obviously more complex query statement, it having a 
> sub-query.  I have tried lots of variations on the following:
> 
>  
> 
>             mysqldump -u root -p --complete-insert 
> "--where=bin_id in (select id from bin where 
> account_id=19444)" -t otm bin_data > 
> /otm/reports/datadump/mediaowner_bin_data.txt
> 
>  
> 
> Am I not wrapping the "where" portion of the command 
> correctly (though I have tried every possible wrapping with 
> single-quotes that I could come up with) OR are sub-queries 
> simply not supported OR is there something else that I should know.
> 
>  
> 
> Any help you can give me would be way appreciated.
> 
>  
> 
> Henry Dall
> 
> [EMAIL PROTECTED]
> 
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to