str()是将数字转成字符串,int和varchar对比,会转换成varchar。但是两个varchar对比,要对比有空格的(这是个坑)。 convert(varchar(36),字段)将字段转成字符,最好用convert