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 |
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2011-12-05 : 04:07:12
|
| Hi All,Iam having clientlist table which contains clients username and the clientversions details.Here is the list of Clisntversions of my table:2.2.0.122.2.0.132.2.0.162.2.0.182.3.0.12.3.0.2From the list we can see the maximum version is 2.3.0.2, but when i ran my query iam getting the maximum client version is 2.2.0.18. please find the below query and help me on the same :select ClientVersion from ClientList where CONVERT(int,REPLACE(ClientVersion,'.','')) = (select distinct MAX(CONVERT(int,REPLACE(ClientVersion,'.',''))) from ClientList)group by ClientVersionThanks,Ramrams |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-05 : 04:17:42
|
| [code]SELECT TOP 1 * FROM table ORDER BY PARSENAME(Clientversions,4)*1 DESC,PARSENAME(Clientversions,3)*1 DESC,PARSENAME(Clientversions,2)*1 DESC,PARSENAME(Clientversions,1)*1 DESC[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jimoomba
Yak Posting Veteran
90 Posts |
Posted - 2011-12-05 : 04:23:54
|
| thanks a lot visakh :)it worked for merams |
 |
|
|
|
|
|
|
|