This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-24. For the latest, interactive version please visit https://mariadb.com/kb/.

INSTR

Sintassi

INSTR(str, substr)

Spiegazione

Restituisce la posizione della prima occorrenza della sottostringa substr nella stringa str. Equivale alla forma di LOCATE() con due argomenti, eccetto che l'ordine dei parametri è invertito.

Esempi

MariaDB [test]> SELECT INSTR('foobarbar', 'bar');
+---------------------------+
| INSTR('foobarbar', 'bar') |
+---------------------------+
|                         4 |
+---------------------------+
1 row in set (0.00 sec)

MariaDB [test]> SELECT INSTR('My', 'Maria');
+----------------------+
| INSTR('My', 'Maria') |
+----------------------+
|                    0 |
+----------------------+
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.