2

表 1:产品分布

ProductID
DistrubutionCentrsID
ProductName
DateOrdered
DateDelivered

在交货日期复制到其他表格。
表 2:产品

ProductID
ProductName
DateOrdered
DateDelivered   

我写了这个,

INSERT INTO ProductDistribution
SELECT ProductID, ProductName, DateOrdered 
FROM Products 
WHERE DateDelivered= getdate()

但它给了我一个错误:

在 expersion 中取消定义函数 getdate()

4

1 回答 1

0

尝试这个

     INSERT INTO ProductDistribution (ProuductID, ProductName , DateOrdered)
     AS
     SELECT ProductID, ProductName, DateOrdered
     FROM Products
     WHERE DateDelivered = getdate()
于 2013-06-09T21:49:42.997 回答