T-SQL常用字符串函数
程序员文章站
2024-01-25 22:42:10
...
T-SQL常用字符串函数 无 ?SELECT SUBSTRING('123456', 2, 3); --'234'SELECT LEFT('123456', 3); --'123'SELECT RIGHT('123456', 3); --'456'SELECT LEN('你好');--2SELECT DATALENGTH('你好');--4SELECT CHARINDEX('23', '1234553');--2SELECT PATINDEX('%[0
T-SQL常用字符串函数? SELECT SUBSTRING('123456', 2, 3); --'234' SELECT LEFT('123456', 3); --'123' SELECT RIGHT('123456', 3); --'456' SELECT LEN('你好'); --2 SELECT DATALENGTH('你好'); --4 SELECT CHARINDEX('23', '1234553'); --2 SELECT PATINDEX('%[0-9]%','abc123gh'); --4 SELECT REPLACE('1-1', '-', '.'); --'1.1' SELECT REPLICATE('A', 4); --'AAAA' SELECT STUFF('ABC', 2, 0, 'abc'); --'AabcBC' SELECT UPPER('AbCd'); --'ABCD' SELECT LOWER('AbCd'); --'abcd' SELECT RTRIM(' abcd '); --' abcd' SELECT LTRIM(' abcd '); --'abcd '