bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL INSERT() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind MySQL INSERT() Function?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ INSERT("ExampleSite.com", 1, 9, "Example");
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The INSERT() function inserts a string within a string at the specified position and for a certain number of characters.
Definition and Usage
MySQL INSERT() Function

Example

SELECT INSERT("ExampleSite.com", 1, 9, "Example");

Definition and Usage

The INSERT() function inserts a string within a string at the specified position and for a certain number of characters.

Syntax

INSERT(
string
,
position
,
number
,
string2
)

Parameter Values

ParameterDescription
stringRequired. The string that will be modified
positionRequired. The position where to insert string2
numberRequired. The number of characters to replace
string2Required. The string to insert into string

Return Values

  • If position is outside the length of string , this function returns string
  • If number is higher than the length of the rest of the string , this function replaces string from position until the end of string

Technical Details

Works in:From MySQL 4.0

Previous

MySQL FORMAT() Function

Next

MySQL INSTR() Function