Category Breadcrumb Path
Hard
Hierarchical Data
For every category return its full path from the root, with names joined by ' > '. Order by id.
Table schema
Categories(id INT PRIMARY KEY, name VARCHAR(50), parent_id INT NULL)Sample data
id | name | parent_id
1 | Electronics | NULL
2 | Phones | 1
3 | Android | 2
4 | Laptops | 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.