At last, here's the solution: NO NEED to group by :-/ ???
Now I ask for a WHY to hackers :)
select sum(t01_caf) as SCAF, sum(t01_itm_cnt) as SCAF
from t01_20011231
where strpos(t01_tree_sortkey,(select t01_tree_sortkey from t01_20011231
where t01_upr_lvl_typ = :TypNiv and t01_upr_lvl_nbr =
:Niv))=1;
--
-- Stangely, I don't really understand why, there is no need of group by clause
-- there!
--
-- Here's the result:
-- scaf | scaf
---------------+---------
-- 40164802.36 | 1404296
--(1 row)
Thanks
--
Jean-Paul ARGUDO IDEALX S.A.S
Consultant bases de données 15-17, av. de Ségur
http://IDEALX.com/ F-75007 PARIS