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)
 SQL Query

Author  Topic 

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2010-09-15 : 07:53:45
Hi,
This is Sample Data

Incident ID Response Time
1130 125
1130 250
1140 2583
1140 200
1140 3000

Each Incident ID have more than one record.How to Select maximum Response time record only

V.NAGARAJAN

kunal.mehta
Yak Posting Veteran

83 Posts

Posted - 2010-09-15 : 08:00:03
select incidentid,max(responsetime)
from table1
group by incidentid
Go to Top of Page

Ancy
Starting Member

23 Posts

Posted - 2010-09-15 : 08:11:20
If you want to select the maximum Response time for a particular Incident ID
----
select [Incident ID], MAX([Response Time])
from <table>
group by [Incident ID]

If you want to select the maximum Response time for the complete table
----
select MAX([Response Time])
from <table>




Go to Top of Page
   

- Advertisement -