How to intercept the first few bits of a string by oracle
This article will explain in detail how oracle intercepts the first few bits of strings. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The method of intercepting the first few bits of a string by oracle
Oracle advances the first few bits of some data with the substr function.
For example, the data in test table is as follows:
To extract the first two bits in the dept field, you can use the following statement:
Select id,name,substr (dept,1,2) from test
Results:
Introduction to substr function:
Syntax:
Substr (string,start,length)
Parameters:
String-the specified string to intercept
Start-required, specifying where to start the string
Positive number-starts at the specified position of the string
Negative number-starts at the specified position at the end of the string
0-starts at the first character in the string
Length-optional, specifies the length of the string to be intercepted, and by default returns all characters before the end of the value of the character expression.
This is the end of this article on "how oracle intercepts the first few bits of a string". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.