'select * from country.db where population>:low and population<:high'
其中 >:low 和 <:high 是指什么意思??
其到什么作用??sql.parambyname('low').asinteger:=strtoint(edit1.text);
sql.parambyname('high').asinteger:=strtoint(edit2.text);这个country.db 里没有 low 和 high 这两个字段啊??为什么要这样写??
谁能说得清楚,立马结帐

解决方案 »

  1.   

    low 和 high 是定义的两个入参select的语句是选择country.db 中population大于edit1.text并且population小于edit2.text的记录。
      

  2.   

    parambyname('low').asinteger 是给low参数赋值
      

  3.   

    记住了是ParamByName而不是FieldByName,ParamByName是用来给参数赋值的!
      

  4.   

    我的意思是:
    为什不是 'select * from country.db where population>200 and population<1000'
    而用上 :low 和 :high 这两个东东??
    ;low 和 :high 是不是一种格式啊??还有 sql.parambyname('low').asinteger:=strtoint(edit.text)
    为什么用('low'),它是怎么得来的??
    我看到上面写着sql语句中的参数前要冠以冒号":",而用要在params中定义???
      

  5.   

    是查询的入口参数
    就是从Edit里面得到想查询的内容,然后复制给查询语句
    以实现动态查询
      

  6.   

    ‘low’和‘high’是表示‘population’字段的两个变量,是一种格式。
    在这里相当于要查询符合population值所在的一个区间。但赋值需用
    sql.parambyname('low').asinteger这种格式来赋,