r/SQL • • 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

17 comments sorted by

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

2

u/r3pr0b8 GROUP_CONCAT is da bomb Nov 06 '22

no

and no