各位好!
我想在delphi应用程序里面建立一个视图,用的语句是:
qry_date:=strtodatetime(edt_date.Text);
qry_sscs.Close;
qry_sscs.SQL.Clear;
qry_sscs.SQL.Add('create view well_goods as select sell.gid ,sum(sell.snumber)as snumber from invoice,sell where invoice.iid=sell.iid and (invoice.itime between :pioneerdate and :latedate) group by gid ');
qry_sscs.ParamByName('pioneerdate').Value:=qry_date;
qry_sscs.ParamByName('latedate').Value:=qry_date+1;
qry_sscs.Prepared:=true;
qry_sscs.execsql;
出现在这样一个问题:General SQL error
incorrect syntax near the leyword 'view';
而去掉create view well_goods as;
去运行select sell.gid ,sum(sell.snumber)as snumber from invoice,sell where invoice.iid=sell.iid and (invoice.itime between :pioneerdate and :latedate) group by gid ');是对的。
所以我感觉是不是在delphi建视图是不是还要加别的什么东西;
请各位帮帮忙看一下;谢谢了!
我想在delphi应用程序里面建立一个视图,用的语句是:
qry_date:=strtodatetime(edt_date.Text);
qry_sscs.Close;
qry_sscs.SQL.Clear;
qry_sscs.SQL.Add('create view well_goods as select sell.gid ,sum(sell.snumber)as snumber from invoice,sell where invoice.iid=sell.iid and (invoice.itime between :pioneerdate and :latedate) group by gid ');
qry_sscs.ParamByName('pioneerdate').Value:=qry_date;
qry_sscs.ParamByName('latedate').Value:=qry_date+1;
qry_sscs.Prepared:=true;
qry_sscs.execsql;
出现在这样一个问题:General SQL error
incorrect syntax near the leyword 'view';
而去掉create view well_goods as;
去运行select sell.gid ,sum(sell.snumber)as snumber from invoice,sell where invoice.iid=sell.iid and (invoice.itime between :pioneerdate and :latedate) group by gid ');是对的。
所以我感觉是不是在delphi建视图是不是还要加别的什么东西;
请各位帮帮忙看一下;谢谢了!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货