Monday, September 23

Select Minimum and Maximum from a table without using Group by clause

Select Minimum and Maximum Salary from a table without using Group by clause.

Use Northwind database, Table Employee

SELECT *
FROM EMPLOYEE
WHERE EMP_GROSSSAL = (SELECT MAX(EMP_GROSSSAL) FROM EMPLOYEE)
 OR EMP_GROSSSAL = (SELECT MIN(EMP_GROSSSAL) FROM EMPLOYEE);

Output: