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 field12. ROUND(): Rounds a numerical field to a specified number of decimal places13. NOW() : Return the current system date and time14. FORMAT(): Format the display mode of a certain field15. INSTR(): Return the character specified in a text field Numeric position16. LEFT(): Returns the left part of a requested text field17. RIGHT(): Returns the right part of a requested text field PHP Chinese website has a large number of freeSQL 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!