select startip from emtb
where substr(str1,1,instr(str1,'.',1,3))=substr(startip
,1,instr(startip,'.',1,3)) and substr(str1,1,instr(str1,'.',1,3))=substr(endip,1,instr(endip,'.',1,3))
and str2>st
and str2<end;现在假设192.168.0.1和60都是用户输入,对应delphi程序中的变量是str1和str2。
请问如何在query中写这条语句?
不胜利感谢!
where substr(str1,1,instr(str1,'.',1,3))=substr(startip
,1,instr(startip,'.',1,3)) and substr(str1,1,instr(str1,'.',1,3))=substr(endip,1,instr(endip,'.',1,3))
and str2>st
and str2<end;现在假设192.168.0.1和60都是用户输入,对应delphi程序中的变量是str1和str2。
请问如何在query中写这条语句?
不胜利感谢!
解决方案 »
- 该过程能否优化
- 學習好delphi是不是要先學pascal?
- TwwDBRichEditMSWord的右键问题,有人碰到过吗?高手的近来看看
- 关于MS AGENT
- 查询的简单问题
- 关于midas三层数据库服务器客户端互相传递文件的新问题,请高手指教,100分保证送
- 用来在1个窗体中显示另1个窗体的构件叫什么?比如:formshow.showform(form2)
- 有没有高手能讲一个VCL底层是如何来运作的???????
- 拿到Delphi Linux------Kylix1。0了!庆祝一下!!
- NetAnts中的.ini在哪里,若无,那他怎么记录option信息?
- 谁知道用CSDN搜索如何输入几个关键字?
- serversocket控件的异常处理
killlaoli
传递参数是什么意思,能不能详细点说明!
给你一个例子:
strwhere:='t_charge'='+''''+name+''''+'and ' +left(t_code,2)='+''''+adodatapro.fields[0].value+'''';
Sql := 'select startip from emtb ' +
'where substr(str1,1,instr(str1,' + #39 + '.' + #39 +
',1,3))=substr(startip,1,instr(startip,' + #39 + '.' +
#39 + ',1,3)) and substr(str1,1,instr(str1,' + #39 +
'.' + #39 + ',1,3))=substr(endip,1,instr(endip,' + #39 +
'.' + #39 + ',1,3)) and str2>st and str2<end'
这样就可以了。
你还可以把字符串中的'改为''
在asp中为:str1=replace(str1,"'","''")
Delphi我不太了解!!!