Skip to tool

SQL SUBSTRING() Online

Extract a substring using start and optional length.

The output updates as you type. The tool processes input in your browser.

Worked example

Specify a zero-based start and a length. Negative starts count from the end in this tool. Use PostgreSQL’s function reference to adapt the input to SQL syntax.

Start
0
Length
"7"
Sample input
manuals.plus
Sample output
manuals

SQL example

SELECT SUBSTRING('manuals.plus' FROM 1 FOR 7);
Expected native output
manuals

Using this operation in SQL

The interactive result uses JavaScript. Check the database dialect. PostgreSQL text functions use SQL-style one-based positions and LIKE uses its own pattern syntax.

SQL reference