Selecting the 2nd row in sql

Posted by Alex Chen on Stack Overflow See other posts from Stack Overflow or by Alex Chen
Published on 2012-06-27T15:05:47Z Indexed on 2012/06/27 15:16 UTC
Read the original article Hit count: 184

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about sql

Related posts about query