在DELPHI中,使用到下面的语句时,总是报ora-00937非单组分组函数,如果不跟参数的情况下,则不会报错,是什么问题.急.谢谢!!(数据库是oracle 9I)
with adoquery1 do
begin
close;
sql.Clear;
sql.Text:='select sum(o_total_weight) total from gspc_item_lists where item_number =:item_number ';
adoquery1.Parameters.ParamByName('item_number').DataType:=ftstring;
adoquery1.Parameters.ParamByName('item_number').Value:=edit1.text;
open; end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Text:='select sum(o_total_weight) total from gspc_item_lists where item_number =:item_number ';
adoquery1.Parameters.ParamByName('item_number').DataType:=ftstring;
adoquery1.Parameters.ParamByName('item_number').Value:=edit1.text;
open; end;
单看你的sql语句不应该有问题
select sum(o_total_weight) total
from gspc_item_lists
where item_number = '变量'
你说的这种情况我一先也有考虑,都是我都认真检查过了.都不行.