How to Use SPLIT_PART in Redshift
Last updated July 25, 2026 · By the SaturnSQL team
SPLIT_PART(string, delimiter, position) splits a string on a delimiter and returns the Nth piece (1-based). It returns an empty string, not NULL, when the position is past the last piece.
SELECT SPLIT_PART('[email protected]', '@', 2) AS domain; -- example.comParse a URL path from events
SELECT SPLIT_PART(page_url, '/', 4) AS section,
COUNT(*) AS views
FROM events
GROUP BY 1
ORDER BY views DESC;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