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
 General SQL Server Forums
 New to SQL Server Programming
 show only one set of numbers

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2009-11-16 : 14:56:02
I have this dataset the last column i want to only show the number for the highest on the first column so a07, b05 and so on.

A01 0.1815557670870152443
A02 0.1815557670870152443
A03 0.1815557670870152443
A04 0.1815557670870152443
A05 0.1815557670870152443
A06 0.1815557670870152443
A07 0.1815557670870152443
B01 0.1755158887269643644
B02 0.1755158887269643644
B03 0.1755158887269643644
B04 0.1755158887269643644
B05 0.1755158887269643644

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-16 : 16:01:06
SELECT SUBSTRING(Col1,1,1), MAX(CONVERT(int,SUBSTRING(Col1,2,1)))
FROM Table
GROUP BY SUBSTRING(Col1,1,1)

????

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -