Skip to tool

SQL Last index Online

Find last index of a substring.

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

Worked example

A repeated substring can have different first and last positions. Browser offsets start at zero. Use PostgreSQL’s function reference to adapt the input to SQL syntax.

Needle
"manuals"
Sample input
manuals plus manuals
Sample output
13

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