select employ.组别,employee.姓名 as 负责人,sum(orders.金额) as 合计 from;
employee,orders where employee.职员号 = orders.职员号 and; employee.职务 ="组长" group by employee.组别 order by 3 desc;
into table tabletwo.dbf
select employee.组别,employee.姓名 as 负责人,sum(orders.金额) as 合计 from;
employee,orders where employee.职员号 = orders.职员号 and;
employee.职务 ="组长" group by employee.组别 order by 3 desc;
into table tabletwo
SELECT employee.组别,employee.姓名 负责人,T1.合计 ; FROM ; (SELECT employee.组别,SUM(orders.金额) 合计 ; FROM employee,orders ; WHERE employee.职员号=orders.职员号 ; GROUP BY 1) T1 ; JOIN employee ; ON employee.组别=T1.组别 AND ; employee.职务="组长" ; ORDER BY 3 DESC ; INTO TABLE TableTwo.DBF