query1.sql.add('select hp01,hp02 from sd');
我想查询以hp开头的字段,

解决方案 »

  1.   

    方法一:在服务器端判断(可用存储过程等),在系统表中查询出字段名然后动态生成sql,执行后返回查询集方法二:在客户端判断,连接表以后,通过查看字段caption属性,筛选出字段,然后再查询。
      

  2.   

    看你是什么数据库了
    到系统表中取你的表的hp开头的字段如mssql
    select name from syscolumns where id=objectname('sd') and name like 'hp%'
      

  3.   

    select hp01,hp02 from sd where
       hp01='hp%' and hp02='hp%'
      

  4.   

    我用的是adoquery,是这样写吗:select sname from sd where pid like 'hp%';//hp01,hp02都是pid.
    是这样吗?