order sql tree hierarchy

前端 未结 8 1570
野的像风
野的像风 2020-12-05 03:30

What is the best way to sort a table like this:

CREATE TABLE category(
    id INT(10),
    parent_id INT(10),
    name VARCHAR(50)
);

INSERT INTO category (         


        
8条回答
提交回复
热议问题