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
 SORTING?

Author  Topic 

rds207
Posting Yak Master

198 Posts

Posted - 2009-08-17 : 17:53:45
Here is the list of the data IN A COLOUMN i have , is there any query where i can sort with the number of chars in a coloumns in SQL SERVER 2007,LIKE I WANT ALL THE BUILDS WITH 14CHARS FIRST LIKE THEN 15 THEN 16 SO ON..
BUILDS
M6260ALYRQ2510
M6260ALYRQ2510
M6260ALYRQ2510gh
M6260ALYRQ2510
M6260ALYRQ2510
M6281ALLRQ4096fg
M6281ALLRQ4096
M6280ALLRQ4090fg
M6281ALLRQ4096
M6260ALYRQ2510r
M6260ALYRQ2510
M6260ALYRQ2510e

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-08-17 : 18:17:26
[code]SELECT Builds FROM myTable ORDER BY Len(Builds), Builds[/code]FYI there is no SQL Server 2007, it's either 2000, 2005, or 2008.
Go to Top of Page
   

- Advertisement -