select * from test where field1 between a and b 

解决方案 »

  1.   

    a 和 b是变量,就是有一个值 x ,求x在误差5%范围内的值,即a = 0.95x; b = 1.05x
    select * from test where field1 between a and b 这样写不对
      

  2.   

    format('select * from test where field1 between %f and %f',['a','b']) 
    改為%f 試試.
      

  3.   

    select * from test where cast(field1 as float) between %s and %s'
      

  4.   

    to:ks_reny 
    format('select * from test where field1 between %f and %f',['a','b']) 
    改為%f 試試.  这个报错,我还换成%e试过,都不行;报错Format %f invalid or incompatible with argumentto: firefly_2008 
    语法错误,操作符丢失
      

  5.   

    谢谢各位的关注,小弟写出来了,用个类型转换val
    select * from test where val(field1) between %s and %s'
    散分了