Mid Syntax:
SELECT MID(column_name,start[,length])
FROM table_name
Students table:
ID | NAME | State |
---|---|---|
1 | Tom | Arizona |
2 | Linda | Texas |
3 | Helen | Florida |
4 | Robert | California |
Mid Example:
SELECT state, MID(state,1,4)
FROM students;
Mid Result:
State | MID(state,1,3) |
---|---|
Arizona | Ari |
Texas | Tex |
Florida | Flo |
California | Cal |