Finds the position of a substring within a string. Supports searching from a specific position and locating the nth occurrence.
INT64Diperbarui: 13 Jun 2026INSTR(value, substring [, position [, occurrence]])The string to search within
The substring to search for
The starting position for the search (default: 1)
The nth occurrence to find (default: 1)
1 SELECT INSTR('Hello World', 'o') as result;
Finds the position of the first 'o'.
1 SELECT INSTR('Hello World', 'o', 1, 2) as result;
Finds the position of the second 'o'.
1 SELECT 2 email, 3 SUBSTR(email, INSTR(email, '@') + 1) as domain 4 FROM `project.dataset.users`;
Extracts the domain from an email address.
Sudah paham INSTR? Latih langsung di browser
Latihan interaktif, langsung di browser.