该
like运营商需要一个字符串作为左边的值。根据文档,从
float到的转换
varchar可以使用几种样式:
Value Output0 (default) A maximum of 6 digits. Use in scientific notation, when appropriate.1 Always 8 digits. Always use in scientific notation.2 Always 16 digits. Always use in scientific notation.
默认样式适用于中的六个数字
3457.68,但不适用于中的七个数字
13457.68。要使用16位数字代替6位数字,可以使用
convert并指定样式2。样式2表示一个类似的数字
3.457680000000000e+003。但这不适用于前两位数字,而且您
+003免费获得了意外的指数。
最好的方法可能是从转换
float为
decimal。该转换使您可以指定比例和精度。使用标度20和精度10,浮点数表示为
3457.6800000000:
where convert(decimal(20,10), num) like '%68%'



