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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-09-12 : 07:39:40
|
| Phil writes "I want to get all values from the rec with the max timeAttributeValue Machine MsgTime Message100 ABC 1am Hello 100 ABC 2am Please 100 ABC 3am Help100 ABC 4am MeSo I want the 4am rec.Select AttributeValue, Machine, MaxMsgTime = Max(MsgTime) -- MessageFrom xHaving thisI can get the 1st 3 values fine, but when I try to get the 4th value(message) by uncommenting the above, it returns all rows." |
|
|
mmarovic
Aged Yak Warrior
518 Posts |
Posted - 2005-09-12 : 07:48:56
|
If I got your intention right:Select top 1 *from xorder by msgTime desc |
 |
|
|
|
|
|