it's correctly to use HAVING clause without mentioning the attribute in the the group by ? for example :
select ncl
from commande c, ligne_commande lc
where c.nc = lc.nc
group by ncl
having count(nart) = ...
nart attribute is not defined in group by