SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 need help on a query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gindaph
Starting Member

Singapore
3 Posts

Posted - 04/09/2013 :  05:42:28  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 04/09/2013 :  05:48:04  Show Profile  Reply with Quote

SELECT NodeID,MAX(CPUIndex) AS CPUIndex
FROM Table1
GROUP BY NodeID


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

gindaph
Starting Member

Singapore
3 Posts

Posted - 04/10/2013 :  03:04:12  Show Profile  Reply with Quote
thanks sir!

works like a charm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 04/10/2013 :  03:10:09  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000