HomeНаука и техникаRelated VideosMore From: The Magic of SQL

Merge: Databases for Developers #17

11 ratings | 672 views
Sometimes when adding rows to your database need update-if-exists, insert-if-not-exists logic. Aka an upsert. You could write this as separate update and insert statements. But there is an easier way: Merge! Watch this video for an overview of how merge works. Further reading: Merge documentation: https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/MERGE.html Delete rows not in the source using merge: https://technology.amis.nl/2006/10/14/have-merge-remove-records-from-target-that-are-not-in-the-source-oracle-10g/ Take the course: https://devgym.oracle.com/pls/apex/dg/class/databases-for-developers-next-level.html Need help with SQL? Ask us over on AskTOM: https://asktom.oracle.com Twitter: https://twitter.com/ChrisRSaxon Daily SQL Twitter tips: https://twitter.com/SQLDaily All Things SQL blog: https://blogs.oracle.com/sql/ ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Html code for embedding videos on your blog
Text Comments (5)
Mohammad Reza Mottaghi (15 days ago)
THAT WAS GREAT, THANKS
The Magic of SQL (15 days ago)
Thanks, glad you liked it :)
D N (5 months ago)
Nice
rahul raj (5 months ago)
Can you make few videos on MATCH RECOGNIZE
The Magic of SQL (5 months ago)
Patience! It's on my to-do list; it'll be a while before I can produce one

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.