第三个数据校验改成这样
SQL("mes2.0test", "select count(GEM02) from gem_file where GEM01 = '" + TRIM(A2) + "' and GEM02 = '" + TRIM(B2) + "'", 1)) > 0
或者
INARRAY(TRIM(B2), array(SQL("mes2.0test", "select GEM02 from gem_file where GEM01 = '" + TRIM(A2) + "'", 1))) <> 0
sql查出来的数据只有一个值或者是空值时,是字符串格式,只有多个值才输出数组,所以可以直接加上array()函数将字符串转化为数组