
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What happens if the argument ‘count’ in MySQL SUBSTRING_INDEX() function has the value greater than the total number of occurrences of delimiter?
MySQL SUBSTRING_INDEX() function will return the same string as output if the argument ‘count’ has the value greater than the total number of occurrences of delimiter. It can be demonstrated with the following example −
mysql> Select SUBSTRING_INDEX('My Name is Ram','a',3); +-----------------------------------------+ | SUBSTRING_INDEX('My Name is Ram','a',3) | +-----------------------------------------+ | My Name is Ram | +-----------------------------------------+ 1 row in set (0.00 sec)
The above query returns the same string because 3 is greater than the total number of occurrences of delimiter provided as argument i.e. ‘a’. There are only two ‘a’ in the string.
- Related Articles
- How MySQL SUBSTRING_INDEX() function returns the substring if we provide the negative value of the argument ‘count’?
- What happens with the output of MySQL EXPORT_SET() function if I will skip the value of the fifth argument i.e. a number of bits?
- What MySQL ELT() function returns if the index number, provided as an argument, is higher than the number of strings?
- What is the use of MySQL SUBSTRING_INDEX() function?
- What happens if I pass only one argument to the MySQL CONCAT() function?
- What MYSQL INTERVAL() function returns if there is no bigger number in the list of arguments than the number at first argument?
- When MySQL SUBSTRING_INDEX() function returns the same string, provided in the argument, as output?
- What happens if a NULL argument is provided in MySQL CONV() function?
- What happens if the output of MySQL TIMEDIFF() function surpass the range value of TIME field?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What MySQL returns if the argument of QUOTE() function is NULL?
- MySQL Aggregate Function to find the number of occurrences?
- What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?
- What happens with the output of MySQL EXPORT_SET() function if I will skip both 4th and 5th argument i.e. separator and number of bits?
- Count number of substrings with numeric value greater than X in C++

Advertisements