sql语句错误
定义变量s,sql为string类型,s为函数参数,sql:='select field1 from table1 where'+s;运行时s赋值为id>7或者id<7、id=7,但是运行时总是出错,请各位帮我改错,多谢!
[解决办法]
showMessage(sql)下看看
sql:='select field1 from table1 where '+s;
有可能where后边要加个空格
[解决办法]
sql:='select field1 from table1 where'+s
这样写不太好吧
改成这样试一试:
sql:='select field1 from table1';
if (条件) then
sql:=sql+'where id>7';
if (条件) then
sql:=sql+'where id<7';
if (条件) then
sql:=sql+'where id=7';
新手回答问题,见笑了!