sql server - How to use JOIN in UPDATE query -


i weak @ join , need know how can convert following query using joins. query working fine sub queries need convert , use making joins.

update dbo.tfin_stmt_line_item_dtl  set stmt_line_item_dtl_desc='changes baseline'  stmt_line_item_dtl_desc='increased hours'  , stmt_line_item_id  in (select tmt_line_item_ref_id      dbo.tfin_stmt_line_item      stmt_line_item_type_id =         (select stmt_line_item_type_id            dbo.tfin_stmt_line_item_type           stmt_line_item_desc 'abox/rbox amendment 18 , 20')) 

please if body can me.

thanks

following query uses joins update table if faster remains seen.

could post query plan can have @ that

update  dbo.tfin_stmt_line_item_dtl  set     stmt_line_item_dtl_desc = 'changes baseline'     dbo.tfin_stmt_line_item_dtl dtl         inner join dbo.tfin_stmt_line_item li on li.tmt_line_item_ref_id = dtl.stmt_line_item_id         inner join dbo.tfin_stmt_line_item_type lit on lit.stmt_line_item_type_id = li.stmt_line_item_type_id   dtl.stmt_line_item_dtl_desc='increased hours'          , lit.stmt_line_item_desc 'abox/rbox amendment 18 , 20' 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -