Functions commonly used to intercept strings in SQL Server:
1.LEFT (character_expression, integer_expression) function Description: Left (' source string ', ' the number of characters to intercept leftmost ') returns the specified number of characters from the start of the string. Ql_server_2008 ', 4); return Result: Sql_
2.RIGHT (character_expression, integer_expression) function Description: Right (' source string ', ' to intercept rightmost number of characters ') returns the integer_expre of the specified number in the string starting from the left Ssion character Select right (' sql_server_2008 ', 4); Results returned: 2008
3.SUBSTRING (character_expression, start, length) function Description: SUBSTRING (' source string ', ' intercept start position (with character at that position ') ', ' intercept length ') returns the character, binary, Text or part of an image expression Select SUBSTRING (' sql_server_2008 ', 5, 6); return Result: Server
Update b set b.typeid=c1.oid,b.brand=c2.oid from Baseinfo_busvehicles B left join Code_content C1 on B.TYPEID=C1.NAMECN
Left join Code_content C2 on B.BRAND=C2.NAMECN
Update a set A.issuemoney=c.depositemoney * A.issuecount from Report_todaycardbusinesssummary a
Left JOIN Businessinfo_consumecards C
On A.cardtype=c.cardtype where a.rechargecenteroid=c.rechargecenteroid and A.terminalsoid=c.terminalsoid and A.cardtype =c.cardtype
and CONVERT (varchar), a.summarydate,23) =convert (varchar (), c.issuedate,23) and
a.oid = ' 002004810af543689ae31473f7151538 '
Update Businessinfo_todayannualsurveyrecords Set
Nextansuvaliddate= ' 2019-' +substring (CONVERT (varchar (7), annualsurveydate,23), 6,7) + '-31 00:00:00.000 '
Functions commonly used to intercept strings in SQL Server