SQL对字符串进行排序
时间:2021-07-01 10:21:17
帮助过:264人阅读
BEGIN
2 DECLARE inString
CHAR(
7);
3 SET inString
= ‘DCDBAAB‘;
4
5 REPLICATE(
‘A‘, (DATA_LENGTH(inString)
-DATA_LENGTH(
REPLACE(inString,
‘A‘,
‘‘))))
6 ||
7 REPLICATE(
‘B‘, (DATA_LENGTH(inString)
-DATA_LENGTH(
REPLACE(inString,
‘B‘,
‘‘))))
8 ||
9 REPLICATE(
‘C‘, (DATA_LENGTH(inString)
-DATA_LENGTH(
REPLACE(inString,
‘C‘,
‘‘))))
10 ||
11 REPLICATE(
‘D‘, (DATA_LENGTH(inString)
-DATA_LENGTH(
REPLACE(inString,
‘D‘,
‘‘))))
12
13 END;
SQL对字符串进行排序
标签:style blog ar color sp on div log bs