How to compare two tables with SQL
HTML-код
- Опубликовано: 24 окт 2023
- 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 livesql.oracle.com/apex/lives...
Read the blog post blogs.oracle.com/sql/post/how...
Test your SQL syntax knowledge with SQuizL; a free, daily guess the SQL statement quiz bit.ly/SQuizL-game - Наука
The absolutly right video in the right moment. Thanks. 😅
You're welcome, glad this helped!
Got a lot, thanks
Amazing
Dang, why didn't i search for that info like 3 days ago. Would have spared me a headache. 😅
How we can use sql macros function in with clause. Sql macros thrown error when we use in with clause.
This is a current limitation; hopefully it'll be possible in a future release