Search Posts

Author: Jernej Pirc

Get Category Level [duplicate]

how to – Get Category Level [duplicate] This question already has an answer here: Getting all parent rows in one SQL query 5 answers In MySql I have category table with fields: cat_id (int) cat_parent_id (int) cat_name (string) How to create query that return list off all categoryes with coresponded level number cat parent_id for root nodes is 0 sample SQL Fiddle with sample data :!9/ba439ae/3 I have MySql version : 5.7.19 and Fiddle […]