How to Use INSTR in Oracle

Last updated August 25, 2026 · By the SaturnSQL team

INSTR(string, substring, position, occurrence) finds a substring's position from a start point, for the nth match. It returns 0 when not found.

SELECT email, INSTR(email, '@') AS at_position
FROM customers;

Position and occurrence arguments

The third argument sets the starting search position (negative values search backward from the end of the string), and the fourth picks which occurrence to return.

SELECT INSTR('a.b.c.d', '.', 1, 2) AS second_dot
FROM dual;

INSTR returns 0 when the substring isn't found, so IS NULL checks against the result never match; test for = 0 instead. Pairing INSTR with SUBSTR is the classic way to split on a delimiter: SUBSTR(email, 1, INSTR(email, '@') - 1) pulls out everything before the @ in a customer's email address.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Do more with Oracle

Related Oracle guides