Home  >  Article  >  Database  >  sql intercepts the first digits of a string

sql intercepts the first digits of a string

angryTom
angryTomOriginal
2020-02-07 12:37:2923817browse

sql intercepts the first digits of a string

sql intercepts the first few digits of the string

In sql, use the LEFT function to get the first few digits of the string Several.

LEFT(c, number_of_char) is used to return the left part of a requested text field, where c represents the requested text field and number_of_cha represents the required The number of digits in the string taken out. For example, "LEFT("www.php.cn", 3)" can obtain the string "www".

Extended information:

In sql, commonly used functions are introduced:

1, AVG(): Return the average value

2 , COUNT(): Returns the number of rows

3, FIRST(): Returns the value of the first record

4, LAST(): Returns the value of the last record

5. MAX(): Returns the maximum value

6. MIN(): Returns the minimum value

7. SUM(): Returns the sum

8. UCASE() : Convert a certain field to uppercase

9, LCASE(): Convert a certain field to lowercase

10, MID(): Extract characters

# from a certain text field ##11. LEN(): Returns the length of a text field

12. ROUND(): Rounds a numerical field to a specified number of decimal places

13. NOW() : Return the current system date and time

14. FORMAT(): Format the display mode of a certain field

15. INSTR(): Return the character specified in a text field Numeric position

16. LEFT(): Returns the left part of a requested text field

17. RIGHT(): Returns the right part of a requested text field

PHP Chinese website has a large number of free

SQL tutorials, everyone is welcome to learn!

The above is the detailed content of sql intercepts the first digits of a string. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Functions of sql languageNext article:Functions of sql language