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 LPAD() Funksie

❮ MySQL-funksies

Voorbeeld

Links-pad die string met "ABC", tot 'n totale lengte van 20:

SELECT LPAD("SQL Tutorial", 20, "ABC");

Definisie en gebruik

Die LPAD() funksie links-pad 'n string met 'n ander string, tot 'n sekere lengte.

Let wel: Kyk ook na die RPAD() funksie.

Sintaksis

LPAD(string, length, lpad_string)

Parameterwaardes

Parameter Description
string Required. The original string. If the length of the original string is larger than the length parameter, this function removes the overfloating characters from string
length Required. The length of the string after it has been left-padded
lpad_string Required. The string to left-pad to string

Tegniese besonderhede

Werk in: Van MySQL 4.0

Meer voorbeelde

Voorbeeld

Links-blokkeer die teks in "CustomerName" met "ABC", tot 'n totale lengte van 30:

SELECT LPAD(CustomerName, 30, "ABC") AS LeftPadCustomerName
FROM Customers;

❮ MySQL-funksies