Selecting the 2nd row in sql
- by Alex Chen
I want to select the second row only from the table. From the ClientUserName column.
SELECT
ClientUserName, DestHost, count(DestHost) counts
FROM
#ProxyLog_record
WHERE
ClientUserName = (Select top 1 ClientUserName from #ProxyLog_count_2)
GROUP BY
ClientUserName, DestHost
ORDER BY
counts DESC
The (Select top 1 ClientUserName from #ProxyLog_count_2) shows top 1 only but I need to get the 2nd data from that table. How can I do this?