尝试使用以下命令插入其他表,但既不抛出错误也不插入:
INSERT INTO orderlines(orderLineItemName,orderLineItemnotes,itemID,itemPriceNormal,categoryID
,regionID,orderLineItemQuantity,orderLineItemPriceUnit,orderLineItemDiscount,orderLineItemSubTotal,
orderLineItemTotalTax
,orderLineItemStatus,userID,orderLineItemDateCreated,orderLineItemDateUpdated,ordercode)
SELECT quoteLineItemName, quoteLineItemnotes, itemID, itemPriceNormal, categoryID, regionID,
quoteLineItemQuantity, quoteLineItemPriceUnit, quoteLineItemDiscount, quoteLineItemSubTotal,
quoteLineItemTotalTax, quoteLineItemStatus, userID, quoteLineItemDateCreated, quoteLineItemDateUpdated,
'Complete' as orderstatus
FROM quoteslines
WHERE quotelineitemid = 1
最佳答案
试试这个
INSERT INTO orderlines
SELECT quoteLineItemName, quoteLineItemnotes, itemID, itemPriceNormal, categoryID, regionID,
quoteLineItemQuantity, quoteLineItemPriceUnit, quoteLineItemDiscount, quoteLineItemSubTotal,
quoteLineItemTotalTax, quoteLineItemStatus, userID, quoteLineItemDateCreated, quoteLineItemDateUpdated,
'Complete' as orderstatus
FROM quoteslines
WHERE quotelineitemid = 1
关于mysql - 使用 mysql 从其他表中选择插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27758264/