Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UPDATE tt
- SET [stbk#] = tt2.[stbk#]
- FROM dbo.TestTable tt
- JOIN dbo.TestTable tt2
- ON tt.sttkt = tt2.sttkt
- AND NULLIF(tt2.[stbk#], '') IS NOT NULL
- update yourtable
- set stbk# = x.stbk#
- from (
- select sttckt, stbk#
- where len(ltrim(rtrim(stbk3)))>0) x
- where len(ltrim(rtrim(yourtable.stbk3)))=0
- and yourtable.sttkt = x.sttkt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement