MySQL- tutoriaal

MySQL TUIS MySQL-inleiding MySQL RDBMS

MySQL SQL

MySQL SQL MySQL KIES MySQL WAAR MySQL EN, OF, NIE MySQL BESTEL DEUR MySQL VOEG IN MySQL NULL-waardes MySQL-OPDATERING MySQL SKEE MySQL-LIMIET MySQL MIN en MAX MySQL COUNT, AVG, SUM MySQL LIKE MySQL Wildcards MySQL IN MySQL TUSSEN MySQL aliasse MySQL sluit aan MySQL BINNE SLUIT AAN MySQL LOS LINKS AAN MySQL REGS SLUIT AAN MySQL KRUIS SLUIT AAN MySQL Self Sluit aan MySQL UNIE MySQL GROEP DEUR MySQL HET MySQL BESTAAN MySQL ENIGE, ALMAL MySQL INSERT SELECT MySQL-GEVAL MySQL nul-funksies MySQL-kommentaar MySQL-operateurs

MySQL- databasis

MySQL Skep DB MySQL Drop DB MySQL Skep tabel MySQL Drop Table MySQL Verander Tabel MySQL-beperkings MySQL nie nul nie MySQL Uniek MySQL-primêre sleutel MySQL buitelandse sleutel MySQL-tjek MySQL verstek MySQL Skep indeks MySQL Outo-verhoging MySQL-datums MySQL-aansigte

MySQL- verwysings

MySQL-datatipes MySQL-funksies

MySQL voorbeelde

MySQL voorbeelde MySQL Vasvra MySQL-oefeninge

MySQL SUBSTRING_INDEX() Funksie

❮ MySQL-funksies

Voorbeeld

Gee 'n substring van 'n string terug voordat 'n gespesifiseerde aantal skeidingstekens voorkom:

SELECT SUBSTRING_INDEX("www.w3schools.com", ".", 1);

Definisie en gebruik

Die SUBSTRING_INDEX()-funksie gee 'n substring van 'n string terug voordat 'n gespesifiseerde aantal skeidingstekens voorkom.

Sintaksis

SUBSTRING_INDEX(string, delimiter, number)

Parameterwaardes

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.

Tegniese besonderhede

Werk in: Van MySQL 4.0

Meer voorbeelde

Voorbeeld

Gee 'n substring van 'n string terug voordat 'n gespesifiseerde aantal skeidingstekens voorkom:

SELECT SUBSTRING_INDEX("www.w3schools.com", ".", 2);

❮ MySQL-funksies