>>>>>>>>这么简单的查询语句,我就是写不出来!!<<<<<<<<<<<
1999 2002-04-15 05:13:23 在form上有12个edit,要根据edit的内容,动态的生产sql语句。
我先定义了一个s:string 。
begin
s:='select * from table ';
if edit1.text<>'' then
s:=s+'where A1='''+edit1.text+''''
else
……
就是每个edit的内容作为where子句的查询条件,但是,像我上面写的话,好像是不行的。
就是我最后生成的查询语句是这样的形式:
select * from table where A1='edit1.text' and A2='edit2.text' and Ax='editx.text';
我该如何写?并且,and是不是可以无限级的使用?