This MariaDB tutorial explains how to use the MariaDB POSITION function with syntax and examples.
The MariaDB POSITION function returns the location of a substring in a string.
The syntax for the POSITION function in MariaDB is:
POSITION( substring IN string )
The substring to search for in string.
The string to search.
The POSITION function can be used in the following versions of MariaDB:
Let's look at some MariaDB POSITION function examples and explore how to use the POSITION function in MariaDB.
For example:
SELECT POSITION('O' IN 'AODBA.com');
Output: 1
SELECT POSITION('O' IN 'AODBA.com');
Output: 1
SELECT POSITION('B' IN 'AODBA.com');
Output: 4
SELECT POSITION('.' IN 'AODBA.com');
Output: 6
SELECT POSITION('V' IN 'AODBA.com');
Output: 0