当前位置:网站首页>Infinite level classification (or menu) design
Infinite level classification (or menu) design
2022-06-11 02:09:00 【Taciturn Thomas】
| id | title | path | level | paths |
|---|---|---|---|---|
| 1 | clothing | 0 | 0 | 0,1 |
| 2 | jacket | 0,1 | 1 | 0,1,2 |
| 7 | shirt | 0,1,2 | 2 | 0,1,2,7 |
| 3 | The trousers | 0,1 | 1 | 0,1,3 |
| 4 | Trousers for | 0,1,3 | 2 | 0,1,3,4 |
| 5 | Long trousers | 0,1,3,4 | 3 | 0,1,3,4,5 |
| 6 | Short trousers | 0,1,3,4 | 3 | 0,1,3,4,6 |
among ,path Represents the parent id list . For example, trousers 0,1,3 It means clothes > The trousers
Just take out the bread crumbs path Value of field , And then use , Division , obtain id list
Reuse where id in (1,3) that will do
When it is necessary to display all categories and represent levels , Use the following SQL:
SELECT *,concat(path,',',id) AS paths FROM menu ORDER BY paths
边栏推荐
- [leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)
- Win11系统使用DISM命令备份驱动程序的方法
- SAP SMARTFORMS换页打印自动判断
- Sword finger offer II 095 Longest common subsequence dynamic programming
- Linux Installation MySQL database details
- Sparrowrecsys recurrence record
- ABAP CDs realizes multi line field content splicing
- Basic underlying principles of concurrent programming (4)
- [matlab] basic image operation (point operation, arithmetic operation, scaling and rotation)
- 5月B站榜单丨飞瓜数据UP主成长排行榜(B站平台)发布
猜你喜欢

20N10-ASEMI中小功率MOS管20N10

Introduction and practice of QT tcp/udp network protocol (II) UDP communication

【音乐】基于matlab演奏《过火》【含Matlab源码 1875期】
![[music] playing city of the sky based on MATLAB [including Matlab source code 1874]](/img/cf/63b04080867e93ab2e00e2e21b37df.jpg)
[music] playing city of the sky based on MATLAB [including Matlab source code 1874]

14:00面试,14:08就出来了 ,问的实在是太...
![[winning] Title A of the 9th Teddy Cup Challenge](/img/86/8445c4ac47d4fa7630544984fa0c58.jpg)
[winning] Title A of the 9th Teddy Cup Challenge

Complete tutorial on obtaining voltage from QGC ground station (APM voltage cannot be obtained from QGC)

Jump without refresh - detailed explanation of pushstate and replacestate methods in history
![[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)](/img/ae/a6e7b8ebb098f631344024ffa80e76.jpg)
[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)
![Is it correct to declare an array in this way? int n=10,a[n]; What if so? const int n =10; int a[n];](/img/e9/b09151d9b92d0a216e2ba079a7beb4.jpg)
Is it correct to declare an array in this way? int n=10,a[n]; What if so? const int n =10; int a[n];
随机推荐
[matlab] image segmentation
[music] playing city of the sky based on MATLAB [including Matlab source code 1874]
【MATLAB】图像基本运算(点运算、算术运算、缩放、旋转)
Byte Beijing 23K and pinduoduo Shanghai 28K, how should I choose?
CRS-4544 & ORA-09925
Basic underlying principles of concurrent programming (4)
面试官:介绍一下你简历中的项目,细讲一点,附项目实战
[leetcode] flat multi-level bidirectional linked list
Sparrowrecsys recurrence record
聊聊一个注解实现接口重试
记录一下我的刷题实录
Our understanding of the industrial Internet may be more out of the existing logic
Alibaba cloud Tianchi online programming training camp_ Task arrangement
---排列数字---
AI fanaticism | come to this conference and work together on the new tools of AI!
Virtual joystick of QT quick QML instance
Battery control of QT widget (qpainter)
Initialize the one-dimensional array a correctly
[leetcode] LRU cache
flutter_ Swiper carousel map plug-in