Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to get TOP 5 and LAST 5 in one query ?

$
0
0
Hi again guys, i'd like to get this query to bring the result in one single query instead of 2 separate results, can you please explain how this can be done? I did some online research but found nothing that could help.
SELECT TOP 5 EventName AS 'Earliest events', EventDate
FROM tblEvent
ORDER BY EventName ASC

SELECT TOP 5 EventName AS 'Latest events', EventDate
FROM tblEvent
ORDER BY EventName DESC


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>