SELECT DEPARTMENT_ID
,(SELECT DEPARTMENT_NAME FROM HR.DEPARTMENTS) AS 'Nome do Departamento'
,MIN(SALARY) AS 'salario minimo'
,MAX(SALARY) AS 'salario maximo'
,CAST(AVG(SALARY) AS NUMERIC(8,2)) AS 'salario medio'
FROM [HR].[EMPLOYEES]
GROUP BY DEPARTMENT_ID
First of all I'm only one started in sql-server! I want to put the department name next to your ID, the problem is that it gives me the following error: "Subquery returned more than 1 value. This is not permitted when the subquery follows =,! =, & Lt ;, < =, & gt ;,> = or when the subquery is used as an expression. "