Rish
Rish

Reputation: 457

to retrieve the Name , Host and SessionId of the of the users with TOP 10 maximum of sessionIds in a particular time

enter image description here

Here is the source Table . I want to retrieve the Name , Host and SessionId of the of the users with TOP 10 maximum of sessionIds in a particular time

Example

Host Name SessionId NoOfSessionsOpen ( 10.42.64.79 , thidrat.xyz , tkj7j , 4 )

Upvotes: 0

Views: 112

Answers (1)

usr
usr

Reputation: 171216

select top 10 Name, Host, SessionID, count(*)
from Table
where TimeLog between @a and @b
group by Name, Host, SessionID
order by count(*) desc, Name, Host, SessionID --define a total sort order for determinism

Upvotes: 1

Related Questions