Reputation: 1211
I'm trying minus command but not working
Compare using column ID
in both table, e.g. table A ID 1 Date vs Table B ID 1 Date
ID
and Date
columnIs it possible to list both tables in one view?
Upvotes: 1
Views: 656
Reputation: 41
SELECT tb1.ID, tb1.Date, tb2.Date
FROM table1 as tb1
INNER JOIN table2 as tb2
on tb1.ID = tb2.ID
WHERE tb1.Date <> tb2.Date
only shows dates that are different. does not take into account that an id could be missing on either table
Upvotes: 1
Reputation: 31676
You should use a TRUNC()
function on the date column. The dates may be same but since time is different MINUS is treating it as 2 different dates.
Upvotes: 0