Friday, October 22, 2010

Sort String in SQL

ID      Salary    Name


1       0            AB123

2       0            AB65

3       0            AB10

4       0            AB25



Sort it on the column Name and we want Output like

this

ID   Salary    Name

1     0           AB123

2    0            AB65

4    0           AB25

3    0          AB10

select CAST(SUBSTRing(Name, 3,4) AS int) as BB,*  from A order by BB desc

No comments:

Post a Comment

Mat Table Angular

Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...