X xykfs Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-11 #1 请问在TQUERY控件中SQL语句能否使用模糊查询和SUM语句等进行计算 代码: []
L louhong Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-11 #3 可以。只不过sql.add的时候语句中的单引号、双引号一定要弄清楚。
J jihe Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-11 #4 select Field from tablename where Field like "%ABc%" select SuM(Field) as SumFIeld from tablename where 条件 adoQUERY.FieldByName('SumFIeld').Asinteger
select Field from tablename where Field like "%ABc%" select SuM(Field) as SumFIeld from tablename where 条件 adoQUERY.FieldByName('SumFIeld').Asinteger
H HunterTeam Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-12 #5 用Sum时应该要用到group语句,所以楼上的第二句应改为: select SuM(Field) as SumFIeld from tablename group by 分组字段