请教VFP9.0中GRoup BY 分组问题
sele 编号,职工号,dtoc(日期) as 日期,姓名,产品编号,零件名称,工序,sum(工时) as 工时,sum(数量)as 数量,sum(数量)/sum(工时) as 数量每小时,sum(计时)as 计时,小计 from scb;where 职工号=zgb or 姓名=xm into cursor zjb group by 产品编号,零件名称,工序
此句在VFP6.0中运行正常,但在9.0中会出现: SQL:缺少Group by 子句或group by子句无效.
若将上面的语句改成以下就可以运行,但出现太多的重复记录.
sele 编号,职工号,dtoc(日期) as 日期,姓名,产品编号,零件名称,工序,sum(工时) as 工时,sum(数量)as 数量,sum(数量)/sum(工时) as 数量每小时,sum(计时)as 计时,小计 from scb;
where 职工号=zgb or 姓名=xm into cursor zjb group by 编号,职工号,日期,产品编号,零件名称,工序,姓名,计时
这个句子太罗索,而且出现很多的重复记录.原因是group by 后加了一个日期,若把日期去掉便又会出现错误.
请各位高手帮忙解决一下.谢谢!