question

WaleedBasit avatar image
WaleedBasit asked

How to update a Master table Record For each Related rows in Details Table

Declare @master table (id int,name varchar(100))

insert into @master values(1,'a'),(2,'b'),(3,'c')

Declare @details table (id int,name varchar(100))

insert into @details values(2,'b2'),(2,'b3')

update a set name=b.name from @master a

inner join @details b on a.id = b.id

select * from @master

inner join
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.