SQL Server????????????
????????????? ???????[ 2016/9/1 9:48:35 ] ????????????? SQL Server ?α?
???????
?????????????????????????????????????????Щ???????????? ?????????????????????????????????????????????????????????????????????????е??·??????????????
???????????? golds??? ?????5??????????????44 ?????ж??????????????????С?
?????????????
?????????????ú???
????1??????????ASCII?? ASCII
????ASCII?????????????????????????ASCII????????????ASCII??????????
??????????
????ASCII(espression)
?????????expression?????????char??varchar??????????????ASCII??????????????????????ASCII?????–????????
???????????int?????????
?????????
????select ASCII(‘f’) –??? 102
??????????????????????????????????????????ASCII?????
????2?????ASCII????????? Char
??????????
????char(integer_expression)
??????????????char?????
?????????
????select char(102) — ???f
????3??????????unicode???? Unicode
????unicode???????????????unicode????
??????????
????unicode(‘ncharacter_expression’)
?????????ncharacter_expression??nchar??nvarchar?????????????????????????????unicode????
???????????int????????
?????????
????SELECT Unicode(‘??’) — ??? 39134
????4?????unicode???????????nchar
????nchar???????unicode???????壬?????????????????????unicode?????
??????????
????nchar(integer_expression)
???????????unicode???
?????????
????SELECT nchar(39134) — ??? ??
????5??????????????LEN
????len????????????????????(?????)?????????????????????????????????????
??????????
????len( string_expression )
?????????????
????string_expression?????????????????
???????????expression?????????varchar(max)??nvarchar(max)??varbinary(max)?????bigint???????int??
?????????
????select len(‘??????????治??’) — ??? 9
????6??REPLACE
??????????????????滻????????????????????
?????????£?
????REPLACE ( string_expression1 ?? string_expression2 ?? string_expression3 )
????????
????string_expression1:??????????????????string_expression1 ?????????????????????????
????string_expression2:???????????????string_expression2 ?????????????????????????
????string_expression3:?滻???????string_expression3 ?????????????????????????
????SELECT REPLACE(‘abcde’??’abc’??’xxx’) –xxxde
????7 ?????λ????????????е?????CHARINDEX
????charindex????????????????????????????????????????????????????????λ???????????????????????????????
??????????
????charindex ( expression1 ?? expression2 [ ?? start_location] )
?????????????
????expression1???????????????????????????а?????????????????С?
????expression2???????????????????????????????????????????????С?
????start_location???????expression2??????expression1??????λ?á????start_locationδ????????????????????????expression2?????????????????????????start_location??????bingint?????
??????????????expression2???????????varchar(max)??nvarchar(max)??varbinary(max)?????bigint???????int??
?????????
????select charindex(‘456′??’123456789’) — ??? 4 ??123456789?м???456?????λ??
????select charindex(‘456′??’123456789’??4) — ??? 4
??????????
?????????????????????????????????????????ο?????????????????????????????????
??????????????????????????????????????
?????????????????????????????????????????????0????????????????????”??
?????????????ascii?????
??????ascii???ASCII ?????????????ASCII ????????? 0–31 ???????????????????????????????Щ??Χ?豸??
???????????1????????????????????????????????char(0)???????char(0)??????????????н???
??????????????????鵽????????????????replace?????滻????????????£????潫?????????????
????????鵽????char??0????????????????????golds????????????????39??char??0?????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11