0
我想通過基於鍵值添加一列的值來獲取記錄。下面是該查詢我:添加一列的值
SELECT
PM_ProductPayment.ProjectId, SalesDetail.SalesPerson,
PM_ProductCost.ProductCost, dbo.PM_ProductPayment.ProductPayment,
dbo.PM_ProductPayment.PaymentDate
FROM
dbo.PM_ProductPayment
INNER JOIN
dbo.PM_Product ON dbo.PM_ProductPayment.ProjectId = dbo.PM_Product.ProductId
INNER JOIN
dbo.PM_ProductCost ON dbo.PM_ProductPayment.ProductId = dbo.PM_ProductCost.ProductId
INNER JOIN
dbo.SalesDetail ON dbo.PM_Product.SalesPersonId = dbo.SalesDetail.ID
我得到的結果是:
現在,在這裏我要加入「支付」每個產品和最後支付獲得單行日期。
請優化我的查詢或提出任何其他更好的方式來做到這一點..
感謝,
_What_是你想要的結果?請不要發佈圖片,但我們可以複製/粘貼的代碼。您可以在編輯器中使用'{}' - 按鈕來格式化代碼。 –