0
我試圖更新在符合我的WHERE子句條件的所有行出口列,它是更新所有行,而不是SQL更新已具有聲明組和
這裏是我到目前爲止
Create table Temp (
Employeeid nvarchar(10),
Punchtype nvarchar (2),
Date Date,
TotalTime decimal (16,2),
Job nvarchar(10),
Exported bit not null Default 0)
Insert Into Temp (Employeeid,Punchtype,Date,TotalTime,Job)
Values ('1234','C','4/24/2017',4,'J1234'), ('1234','RW','4/24/2017',4,'J1234'),('4563','C','4/24/2017',2,'J1234'), ('4563','C','4/24/2017',5,'J1234')
Update temp set exported = 1 where exists (select null from temp group by employeeid,Date,Job having Min(punchtype) = MAX(punchtype))