Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind MySQL SUBSTRING_INDEX() 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.
___ SUBSTRING_INDEX("www.ExampleSite.com", ".", 1);3Order
Put the learning moves in the order that makes the concept easiest to apply.
The SUBSTRING_INDEX() function returns a substring of a string before a specified number of delimiter occurs.
Definition and Usage
MySQL SUBSTRING_INDEX() Function
Example
SELECT SUBSTRING_INDEX("www.ExampleSite.com", ".", 1);Definition and Usage
The SUBSTRING_INDEX() function returns a substring of a string before a specified number of delimiter occurs.
Syntax
SUBSTRING_INDEX(
string
,
delimiter
,
number
)Parameter Values
| Parameter | Description |
|---|---|
| string | Required. The original string |
| delimiter | Required. The delimiter to search for |
| number | Required. The number of times to search for the delimiter. Can be both a positive or negative number. If it is a positive number, this function returns all to the left of the delimiter . If it is a negative number, this function returns all to the right of the delimiter . |
Technical Details
| Works in: | From MySQL 4.0 |
|---|