group by 的问题
with ADOQ_dscj do
begin
close;
sql.Clear;
sql.Add( 'select dscj,cx from ZZP_ZPJHTZ where zt= ' '转调试 ' ' and xxrq:=xxrq and cx=:cx group by dscj,cx ');
Parameters.ParamByName( 'cx ').Value:=ADOQ_XXLR.FieldByName( 'cx ').AsString;
Parameters.ParamByName( 'xxrq ').Value:=FormatDateTime( 'YYYY-MM-DD ',now);
Prepared;
open;
end;
执行到open报错:不是group by 表达式 急!急!急!急!
[解决办法]
这样的SQL语句我写过,如果你连的是ACCESS数据库就没问题,如果是ORACLE就会出现以上问题,好像是ORACLE里不支持带参数的GROUP by。