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 : http://sqlfiddle.com/#!9/ba439ae/3
I have MySql version : 5.7.19 and Fiddle is on 5.6