Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Merge statement
--Title of this code --Batches are separated by 'go' select * from planes merge planes as target_planes --target table, could be common table expression using (select * from planes) as source_planes --source table, here the same as target on target_planes.Model = source_planes.Model when not matched then insert(Model, Built_date, Number_of_seats) --insert into target values(source_planes.Model, source_planes.Built_date, source_planes.Number_of_seats) when matched then /*delete*/ update set target_planes.Number_of_seats = 2*target_planes.Number_of_seats; select * from planes
run
|
edit
|
history
|
help
0
Orders
SS my sql server 2014 4/7
sqlserver
Task_3_FInal
Generate xml
Names
Cinema latinoamericano
Demo
tesing
Show slowest queries