I find the MINUS operator very handy and use it a lot to compare tables and find out missing things.
For example suppose you want to compare Table1 with Table2.
If the two tables have the same layouts (same column names and data content), you can simply do this
This query will compare each record in Table 1 to a record in table 2.
The result returned will be records in table 1 that are not in table 2.
you can reverse the MINUS order to get records in table 2 that are not in table 1
You can also instead of doing select *, select specific columns, since for example the 2 tables might have been loaded and timestamped differently.
So you can do
You have to make sure the column orders are the same when selecting from the tables.
| Title | Under | Posted on |
|---|---|---|
| Embed External page into peoplesoft | PeopleSoft Technical | 06/30/2009 - 3:43am |
| Information required on Peoplesoft SCM tables | PeopleSoft Functional | 06/29/2009 - 6:02am |
| How do I return multiple rows when using START WITH in an Oracle stored procedure? | SQL & PL/SQL | 06/09/2009 - 3:44pm |
| Staging table issues | PeopleSoft Functional | 06/07/2009 - 6:59pm |
Comments
Post new comment