How to compare two tables with SQL

Published: 25 October 2023
on channel: Oracle Developers
5,517
91

Often you want to compare two tables to see if there are any differences in their rows.

The classic way to do this is with set operations. But this means reading all of both tables twice!

In this session, we'll look at other methods to do this, including full outer joins and group by queries.

Highlights include:

00:50 - Using set operations to compare tables
03:20 - Using full outer joins to compare tables
10:35 - Using group by to compare tables
13:50 - Demo of set operation method
15:15 - Demo of full outer join methods
19:00 - Demo of group by method
25:50 - Table comparison methods summary
27:50 - SQL macro comparison functions
29:50 - Comparing queries
31:40 - Finding table changes over time
34:20 - Unpivot to get column differences as rows
36:55 - Demo of comparison macro
37:50 - Demo of comparing queries
41:10 - Demo of finding table changes
43:20 - Demo of column differences
46:10 - Performance comparison demo
55:05 - Cheat sheet of approaches

Get the scripts https://livesql.oracle.com/apex/lives...
Read the blog post https://blogs.oracle.com/sql/post/how...

Test your SQL syntax knowledge with SQuizL; a free, daily guess the SQL statement quiz https://bit.ly/SQuizL-game


Watch video How to compare two tables with SQL online without registration, duration hours minute second in high quality. This video was added by user Oracle Developers 25 October 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,517 once and liked it 91 people.