我正在尝试从 MS SQL Server 2005 表中获取数据并将其插入到链接的 MySQL 表中,我的查询如下但它不起作用。我不断收到“查询执行成功,0 行受影响”。任何帮助将不胜感激!
INSERT INTO OPENQUERY(WEBSITE, 'SELECT SalesID,Cust,OrderDate,PONum,PartNo,QTY,PartDesc,DiscPct,DueDate,ShipCity,ShipSt,OrderStatus,InvoiceNo,InvDate,OrderTotal FROM orders')
SELECT Orders.SalesID, Orders.CustDesc, Orders.DateEnt, Orders.PONum, OrderDet.PartNo, OrderDet.QtyOrdered, OrderDet.PartDesc, OrderDet.DiscPct, OrderDet.DueDate, Orders.ShipCity, Orders.ShipSt, OrderDet.Status, BillingDet.InvoiceNo, Billing.InvDate, Orders.OrderTotal
FROM Orders INNER JOIN OrderDet ON (Orders.OrderNo = OrderDet.OrderNo)
LEFT JOIN BillingDet ON (Orders.PONum = BillingDet.PONum)
LEFT JOIN Billing ON (BillingDET.InvoiceNo = Billing.InvoiceNo)
WHERE OrderDet.PartNo LIKE '%^%' AND Orders.DateEnt >='2011/12/31'