UPDATE MarkingDetail
SET StatusEditRequis = 'True'
WHERE
(
SELECT CancelRequis.Number,CancelRequis.ProductID,CancelRequis.Amount_Cancel,CancelRequis.Amount_Edit,MarkingDetail.StatusEditRequis
FROM MarkingDetail Inner JOIN CancelRequis ON CancelRequis.Number = MarkingDetail.ProductNo
WHERE MarkingDetail.Product=CancelRequis.ProductID And CancelRequis.Amount_Edit >= CancelRequis.Amount_Cancel And CancelRequis.Number='550034'
Group By CancelRequis.Number,CancelRequis.ProductID,CancelRequis.Amount_Cancel,CancelRequis.Amount_Edit,MarkingDetail.StatusEditRequis
)
Tag : .NET, Ms SQL Server 2005
Date :
2012-04-02 16:39:51
By :
chin
View :
978
Reply :
1
No. 1
Guest
Code
UPDATE MarkingDetail
SET StatusEditRequis = 'True'
WHERE
(
SELECT CancelRequis.Number,CancelRequis.ProductID,CancelRequis.Amount_Cancel,CancelRequis.Amount_Edit,MarkingDetail.StatusEditRequis
FROM MarkingDetail Inner JOIN CancelRequis ON CancelRequis.Number = MarkingDetail.ProductNo
WHERE MarkingDetail.Product=CancelRequis.ProductID And CancelRequis.Amount_Edit >= CancelRequis.Amount_Cancel And CancelRequis.Number='550034'
Group By CancelRequis.Number,CancelRequis.ProductID,CancelRequis.Amount_Cancel,CancelRequis.Amount_Edit,MarkingDetail.StatusEditRequis
)
UPDATE MarkingDetail
SET StatusEditRequis = 'True'
WHERE id in
(SELECT CancelRequis.Number
FROM MarkingDetail Inner JOIN CancelRequis ON CancelRequis.Number = MarkingDetail.ProductNo
WHERE MarkingDetail.Product=CancelRequis.ProductID And CancelRequis.Amount_Edit >= CancelRequis.Amount_Cancel And CancelRequis.Number='550034'
)