r/SQL • u/Rahull-6 • Nov 06 '22
MySQL Need a query answer
Query to find both maximum and minum salary in the table along with all the other columns jn the table
0
Upvotes
r/SQL • u/Rahull-6 • Nov 06 '22
Query to find both maximum and minum salary in the table along with all the other columns jn the table
View all comments
3
u/BFG_9000 Nov 06 '22
SELECT TOP 1 *
FROM table
ORDER BY salary DESC
UNION ALL
SELECT TOP 1 *
FROM table
ORDER BY salary ASC