Compares two datasets defined by SQL