Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Explain in detail the usage of Substring function in SqlServer database

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Function: returns part of a character, binary, text, or image expression

Syntax: SUBSTRING (expression, start, length)

1. Substring (the string of the operation, the position where the intercept begins, and the number of characters returned)

For example:

Returns the use of the ccc',charindex function from 'abbccc'' (charindex (the string to be found, the string to be found, the location to start the search), for example, to find the location of the first'c'in 'abbccc', charindex.

Declare @ str1 varchar (255) declare @ str2 varchar (255) set @ str1 = 'abbccc' set @ str2 = substring (@ str1,charindex (@ str1)-charindex (' cantilevered journal str1) + 1) print @ str2

Summary

The above is the use of the Substring function in the SqlServer database introduced by the editor. I hope it will be helpful to you. If you have any questions, you are welcome to leave a message. The editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report