Non-recursive unlimited classification. For more information, see section 2012-09-0510: 19: 59, cid is the column ID, category is the column name, chain is the relationship tree, rank is the column sorting mysql & gt; non-recursive unlimited classification, problem, please give pointers
At the end of this post, vbker edited the following database fields at 10:19:59 on. Currently, it uses region as the column, cid as the column ID, category as the column name, chain as the relationship tree, and rank as the column order.
Mysql> select * from mc_category;
+ ----- + ---------- + -------------- + ------ +
| Cid | category | chain | rank |
+ ----- + ---------- + -------------- + ------ +
| 1 | domestic | 0_1 | 2 |
| 2 | outside China | 0_2 | 1 |
| 3 | North China | 0_1_3 | 2 |
| 4 | northeast China | 0_1_4 | 1 |
| 5 | West | 0_00005 | 3 |
| 6 | Henan | 0_1_3_6 | 1 |
| 7 | Zhengzhou | 0_1_3_6_7 | 2 |
| 8 | | 0_1_3_6_7_8 | 1 |
| 9 | Luoyang | 0_1_3_6_9 | 1 |
| 10 | Yanshi | 0_1_3_6_9_10 | 1 |
| 11 | Liaoning | 0_1_4 | 3 |
| 12 | Jilin | 0_20174_11_12 | 1 |
| 13 | Shangjie | 0_1_3_6_7_13 | 2 |
+ ----- + ---------- + -------------- + ------ +
Use
select category,chain from mc_category group by chain order by chain;
The directory tree can be listed according to the correct parent-child relationship, but now I still need to sort the columns at the same level by rank value. can this be done using mysql?
========================================================== ============================== Share :? Select? *? From? Mc_cate... 'data-pics = ''>