在多个表上转储查询

时间:2017-12-15 10:05:57

标签: mysql dump

我试图从三个表之间的查询中获取一个sql输出文件。 以下是我的代码:

#import "ProductModuleName-Swift.h"

这给我一个错误:

mysqldump --user=user --password=password --host=localhost dbname --where="SELECT v.ITEM_ID , v.CODE ,\
s.SENSOR , d.DESTINATIONCODE \
FROM  V_TABLE v, S_TABLE s ,D_TABLE d \
WHERE s.ITEM_ID = v.ITEM_ID \
AND s.CREATIONDATETIME <  '2014-2-16 00:00:00'\
AND v.DESTINATION_ID=d.ID" > /var/www/dumps/output_15_12_2017.sql

使用\

时可能是错误的

1 个答案:

答案 0 :(得分:2)

要使用类似的查询,您可以将其发送到// variable required to see work in action var count = 0 class CustomTabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // remember to assign delegate delegate = self } // this delegate indicates whether this tab should be selected or not extension CustomTabBarController : UITabBarControllerDelegate{ func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { // switch to UIViewController tabs multiple times count = count + 1 if(count == 5){ // when count reaches 5 a new controller will load let navigationController = viewController as? UINavigationController guard navigationController != nil else {return true} let viewController = storyboard?.instantiateViewController(withIdentifier: "ItemThreeVC") guard let vc = viewController else {return true} navigationController?.setViewControllers([vc], animated: false) } return true } } 客户端(而不是mysql实用程序),然后将该输出重定向到文件:

mysqldump

如果您要使用此路线,则echo "SELECT v.ITEM_ID , v.CODE ,\ s.SENSOR , d.DESTINATIONCODE \ FROM V_TABLE v, S_TABLE s ,D_TABLE d \ WHERE s.ITEM_ID = v.ITEM_ID \ AND s.CREATIONDATETIME < '2014-2-16 00:00:00'\ AND v.DESTINATION_ID=d.ID\ " | mysql --user=user --password=password --host=localhost dbname > /var/www/dumps/output_15_12_2017.sql --batch选项可能会有用。