08-02-2015 04:00 AM
I am performing left join on 2 tables. I want to perform VLOOKUP for a column which I am applying using Left Join as per my requirement. Before the Left join, I have 1735 obs which is the correct number. Post the join I get 1736 obs, which is incorrect. I am not understanding as to how should I debug where is the error.
08-02-2015 01:43 PM
The error is likely the presence of a duplicate entry in your second (right) table. Try
select * from secondTable
group by ID
having count(*) > 1;
where ID is your join column, to identify the problem records in the second table.