Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 records having more than one distinct value in top 5

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-03-20 : 09:04:40
Aaron writes "I have a table with this type of structure:

tIndex ComputerName DisplayName UserID Time

It contains up to 15 records for each machine, listing the last 15 times we have scanned the machine, who was logged on at the time of the scan and the time of the scan.

I need a list of machines where there is more than 1 distinct value in the top 5 records by time or the top 5 tIndex which is an auto increment column."

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-20 : 09:26:51
Please provide some sample data and the expected output.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -