开发者

Update status column where status is null

Anyone can help in query

I want to fetch one by one record from startdate to enddate in the table and update one by one record from the table

Like I am having one table Temp

ID   DATE          Status
1    2011-09-10      WO
2    2011-09-11      WO
3    2011-09-12     NULL
4    2011-09-13     NULL
5    2011-09-14     NULL
6    2011-09-15      H

No开发者_运维百科w i need the output like below when i used give startDate and enddate then Status which have NULL value should get 'L'

ID   DATE          Status
1    2011-09-10      WO
2    2011-09-11      WO
3    2011-09-12       L
4    2011-09-13       L
5    2011-09-14       L
6    2011-09-15      H


Why do you have to do this "one by one"?

UPDATE dbo.Temp SET Status = 'L' WHERE Status IS NULL;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜