var str1,str2:string;给变量str1,str2赋值
Query1.sql.add('where 比赛场次=:times and '+str1+'<>0 order by '+str2+' DESC');

解决方案 »

  1.   

    Query1.SQL.Add ('where 比赛场次=:times and Str1:<>0 order by Str1: DESC');
    Query1.ParaByname('Str1').asinteger:=;
    Query1.ParaByname('Str2').asString:=;
      

  2.   

    to netlib(河外孤星):
    字段名,表名可以用参数代?你试过没有啊?再说参数也应该写成 :Str1 呀。我试过,不行!
      

  3.   

    order by 后显然是不能用变量的
    oracle_lover(数据库情人)的方法是正确的