Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;with cte as
- (
- SELECT WeekNum
- FROM MonitorTable
- GROUP BY WeekNum
- HAVING SUM(CASE WHEN IsProcessed = 1 THEN 1
- ELSE 0
- END) = 8
- order by WeekNum
- ) update MonitorTable set ReadToGrid = 0 where WeekNum in (select WeekNum from cte)
- 1
- 2
- 3
- 4
- 5
- 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement