Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Split a Delimited String into Rows

The Tags table stores comma-separated tags per post. Return one row per (post_id, tag), ordered by post_id then tag. (Use a recursive CTE.)

Table schema

Posts(post_id INT PRIMARY KEY, tags VARCHAR(30))

Sample data

post_id | tags
1 | sql,db
2 | api
3 | ds,algo,sql

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.