A
AlexT
Hello
I am having some problems designing an update query
Here is my current (non working) query
UPDATE dbo. myTable
SET dcStatus = 1
FROM (SELECT *
FROM myTable INNER JOIN
dbo.qStatusHelper as t1 ON
(t1.dcIdx = dbo.myTable.dcIdx))
WHERE (dcStatus < 99) AND (t1.NumMatched = t1.NumLines)
What I'd like to achieve is to set myTable.dcStatus to 1 when
a) the current value of dcStatus is less than 99
AND
b) the values NumMatched = NumLines are identical in the
qStatusHelper query, which is a subset of myTable
I'm pretty sure is possible... but I simply can't figure it out !
Any help most welcome
I am having some problems designing an update query
Here is my current (non working) query
UPDATE dbo. myTable
SET dcStatus = 1
FROM (SELECT *
FROM myTable INNER JOIN
dbo.qStatusHelper as t1 ON
(t1.dcIdx = dbo.myTable.dcIdx))
WHERE (dcStatus < 99) AND (t1.NumMatched = t1.NumLines)
What I'd like to achieve is to set myTable.dcStatus to 1 when
a) the current value of dcStatus is less than 99
AND
b) the values NumMatched = NumLines are identical in the
qStatusHelper query, which is a subset of myTable
I'm pretty sure is possible... but I simply can't figure it out !
Any help most welcome