All pastes #183818 Raw Edit

Mine

public sql v1 · immutable
#183818 ·published 2006-09-27 08:42 UTC
rendered paste body
select GRUP, CLIENT, COD_CLIENT, NUME, SUMA   from TBL where GRUP in ( select GRUP, sum(SUMA)                    from TBL                   group by GRUP                  order by sum(SUMA) desc                  limit 10  ) order by GRUP,CLIENT;