conditionally check rows of common columns