Select 列出除了col12, col13外的所有列名
From(select *, cast(dbo.split(col1,2) as int) As col12, cast(dbo.split(col1 ,3) as int) As col13 from maps_all) A
Order By col12, col13
Select 列出除了col12, col13外的所有列名
From(select *, cast(dbo.split(col1,2) as int) As col12, cast(dbo.split(col1 ,3) as int) As col13 from maps_all) A
Order By col12, col13
Create Table [table]
(col1 Varchar(100))
Insert [table] Select 'A-12-156'
Union All Select 'A-8-25'
Union All Select 'A-8-27'
GO
select * from [table]
order By left(col1,1),right(col1,2)
GO
Drop Table [table]
--Result
/*
col1
A-8-25
A-8-27
A-12-156
*/
Select 列出除了col12, col13外的所有列名
From(select *, cast(dbo.split(col1,2) as int) As col12, cast(dbo.split(col1 ,3) as int) As col13 from maps_all) A
Order By col12, col13
Create Table [table]
(col1 Varchar(100))
Insert [table] Select 'A-12-156'
Union All Select 'A-8-25'
Union All Select 'A-8-27'
GO
select * from [table]
order By left(col1,1),right(col1,2)
GO
Drop Table [table]
--Result
/*
col1
A-8-25
A-8-27
A-12-156
*/
Create Table [table]
(col1 Varchar(100))
Insert [table] Select 'A112'
Union All Select 'B113'
Union All Select 'D125'
Union All Select 'C136'
Union All Select 'A128'
GO
select * from [table]
order By left(col1,1),right(col1,2)
GO
Drop Table [table]
--Result
/*
col1
A112
A128
B113
C136
D125
*/
Create Table [table]
(col1 Varchar(100))
Insert [table] Select 'A112'
Union All Select 'B113'
Union All Select 'D125'
Union All Select 'C136'
Union All Select 'A128'
GO
select * from [table]
order By left(col1,1),right(col1,2)
GO
Drop Table [table]
--Result
/*
col1
A112
A128
B113
C136
D125
*/