Tengo la siguiente consulta
select A.AuxstockArrProductoId, B.ProductoNombre, (A.AuxstockArrSubctaCant)as total
from AuxSctaStockArr A
inner join Producto B on A.AuxstockArrProductoId = B.ProductoId
group by A.AuxstockArrProductoId
having sum(A.AuxstockArrSubctaCant) > 0
order by A.AuxstockArrProductoId
Necesito agregar al lado del copdigo del producto, el nombre del mismo, pero me sale un error en la consulta que dice :
Mens. 8120, Nivel 16, Estado 1, Línea 1 Column 'Producto.ProductoNombre' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Alguien que me pueda indicar como se podría agregar el nombre del producto en esta consulta por favor.