New versions: Dev (3.15) | Latest (3.14) | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3
SPACE
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The SPACE()
function repeats a space character a number of times. This is convenience for REPEAT, as available natively in SQL Server, for example.
SELECT 'a' || space(3) || 'b';
create.select(val("a").concat(space(3)).concat(val("b")).fetch();
The result being
+-------+ | space | +-------+ | a b | +-------+
Dialect support
This example using jOOQ:
space(3)
Translates to the following dialect specific expressions:
-- ASE, AURORA_MYSQL, CUBRID, DB2, H2, MARIADB, MYSQL, SQLDATAWAREHOUSE, SQLSERVER, SYBASE, VERTICA space(3) -- AURORA_POSTGRES, COCKROACHDB, HSQLDB, POSTGRES, REDSHIFT repeat(' ', 3) -- FIREBIRD, HANA, INFORMIX, INGRES, MEMSQL, ORACLE, TERADATA rpad(' ', 3, ' ') -- SQLITE ' ' || substr("replace"(hex(zeroblob(3)), '00', ' '), 1, 3 - length(' ')) -- ACCESS, BIGQUERY, DERBY, IGNITE, SNOWFLAKE /* UNSUPPORTED */
(These are currently generated with jOOQ 3.15, see #10141)
Feedback
Do you have any feedback about this page? We'd love to hear it!