Compares two data in two database queries