Comparison between tables A and B