Funktionen zur Datenbearbeitung in PostgreSQL
Brian Piccolo
Sr. Director, Digital Strategy
TRIM([leading | trailing | both] [characters] from string)
Erster Parameter: [leading | trailing | both] (vorangestellt/nachgestellt/beides)
Zweiter Parameter: [Zeichen]
Dritter Parameter: aus der Zeichenfolge
SELECT TRIM(' padded ');+--------+ | TRIM | |--------| | padded | +--------+
SELECT LTRIM(' padded ');+------------+ | LTRIM | |------------| | padded | +------------+
SELECT RTRIM(' padded ');
+----------+
| RTRIM |
|----------|
| padded |
+----------+
SELECT LPAD('padded', 10, '#');+-------------+ | LPAD | |-------------| | ####padded | +-------------+
SELECT LPAD('padded', 10);+-------------+ | LPAD | |-------------| | padded | +-------------+
SELECT LPAD('padded', 5);+------------+ | LPAD | |------------| | padde | +------------+
SELECT RPAD('padded', 10, '#');
+-------------+
| RPAD |
|-------------|
| padded#### |
+-------------+
Funktionen zur Datenbearbeitung in PostgreSQL