My current solution:
SELECT DEPT_NAME,SALARY
FROM EMPLOYEE
WHERE (DEPT_NAME,SALARY) IN (SELECT DEPT_NAME,MAX(SALARY) AS MAXIMUM_SALARY
FROM EMPLOYEE
GROUP BY DEPT_NAME)
I don't know why this query worked in PostgreSQL but not in SQL-Server. It's throwing the following error:
An expression of non-boolean type specified in a context where a condition is expected, near ','.
Can anyone help me with this?
This is a subquery which returns multiple rows and columns.
After that I used the join condition which gave me the results but I want to know why the above query using is not working in SQL Server.