私はカスタムソート順
1.19.3
1.19.x
1.2.3
1.20.3
1.4.168
1.4.18
1.x.x
20MyTest
DEC09
dec09
MyTest20
N/A
Plutonium
が、私は希望を出力し、この
declare @testtable table (test nvarchar(max))
insert into @testtable (test) values ('1.2.3')
insert into @testtable (test) values ('1.20.3')
insert into @testtable (test) values ('1.19.x')
insert into @testtable (test) values ('1.x.x')
insert into @testtable (test) values ('1.19.3')
insert into @testtable (test) values ('DEC09')
insert into @testtable (test) values ('Plutonium')
insert into @testtable (test) values ('dec09')
insert into @testtable (test) values ('N/A')
insert into @testtable (test) values ('MyTest20')
insert into @testtable (test) values ('20MyTest')
insert into @testtable (test) values ('1.4.18')
insert into @testtable (test) values ('1.4.168')
select * from @testtable
order by test asc;
は、出力順序がある必要はあり
1.2.3
1.4.18
1.4.168
1.19.3
1.19.x
1.20.3
1.x.x
20MyTest
DEC09
dec09
MyTest20
Plutonium
N/A
(N/Aは "魔法"で、常に最大ですが、 "バージョン"(例1.2.3)は常に3桁ですが、1つ以上の桁はchar x可能な限り最大の数字と考えられる「任意の数字」を指定してください)
これをSQL Serverでどのように達成できますか?
+ 1 DDLおよびINSERTの場合。どのSQL Serverのバージョンですか? –
ソリューションは異なるサーバーに配置されるため、このバージョンは異なります – Millerbean
*どのように違いますか?これを実行したい最初のバージョンは何ですか?適切なタグを追加してください。 –