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 2000 Forums
 SQL Server Development (2000)
 Getting the data from the columns NOT included in the Aggregate Function or in the GROUP BY Clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-27 : 10:18:45
Victor Hugo writes "A system reads information from an equipment every 5 minutes and store it in a table, like this:

DateTime - Date and time of the reading.
Value1 - Main value
GroupFld1 - Has to be grouped by this field
GroupFld2 - And this field.

How do i get the value of DateTime where the MAX(Value1) ocurred without including DateTime in the GROUP BY Clause?

Note: the DateTime value can be repeated since the readings come from a number of equipments.

Using:
SQL Server 7.0
Windows NT Server 4 SP 6

You'll be my hero if you can give me a clue of how to do this.

Thanks."
   

- Advertisement -