The POSITION function can be used in supported SQL systems to determine where a specified substring occurs within another string.
Finding text positions is useful when extracting or analyzing structured text values.
Find the position of the @ symbol in an email address.
SELECT
Email,
POSITION('@' IN Email) AS AtPosition
FROM Customers;
It is useful for email analysis, identifier parsing, text validation, and data cleansing.
- POSITION searches for a substring.
- It returns the location of the substring.
- Syntax can vary by database.
- It is useful for parsing text.
- It can be combined with substring functions.
What does POSITION do?
POSITION finds the location of a specified substring within another string.
Where can POSITION be useful?
It can be useful when parsing structured text such as email addresses or identifiers.