mysql MID() function


  Translation results:

英[mɪd] 美[mɪd]

adj. Middle; centered; (used in compound words) in

prep. In the middle of...; in the middle of the sky

adv.In the middle of the hull

n.Mid-year, mid-school year

mysql MID() functionsyntax

Function: is used to extract characters from text fields.

Syntax: SELECT MID(column_name,start[,length]) FROM table_name

Parameters:

ParametersDescription
column_name Required. The field from which characters are to be extracted.
start Required. Specifies the starting position (starting value is 1).
length Optional. The number of characters to return. If omitted, the MID() function returns the remaining text.​

mysql MID() functionexample

//从 "City" 列中提取前 3 个字符
SELECT MID(City,1,3) as SmallCity FROM Persons;

Popular Recommendations

Home

Videos

Q&A