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)
 need help on a query

Author  Topic 

gindaph
Starting Member

3 Posts

Posted - 2013-04-09 : 05:42:28
Hi guys,

I have one table below

Table1
NodeID CPUIndex
1 0
1 1
1 2
2 0
2 1
2 2
2 3
2 4

And I only want to get the Max CPUIndex for each of the Node, like the one below

NodeID CPUIndex
1 2
2 4



TIA!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-09 : 05:48:04
[code]
SELECT NodeID,MAX(CPUIndex) AS CPUIndex
FROM Table1
GROUP BY NodeID
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

gindaph
Starting Member

3 Posts

Posted - 2013-04-10 : 03:04:12
thanks sir!

works like a charm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-10 : 03:10:09
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -