当前位置:网站首页>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
边栏推荐
- 【MATLAB】图像压缩编码(DCT、RLE)
- QT database learning notes (II) QT operation SQLite database
- Me11/me12 purchase information record and condition record creation and update bapi:me_ INFORECORD_ MAINTAIN_ MULTI
- 【音乐】基于matlab演奏《过火》【含Matlab源码 1875期】
- 记录一下我的刷题实录
- 接口自动化核心知识点浓缩,为面试加分
- Deep exploration of functions with indefinite parameters in C language
- Battery control of QT widget (qpainter)
- [QT] error: qapplication: no such file or directory solution
- Task02: basic use of database (MySQL)
猜你喜欢

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

(已解决)Latex--取消正文中参考文献引用的上标显示(gbt7714-2015会导致默认上角标引用)(上角标&平齐标混合使用教程)

软件测试面试复盘:技术面没有难倒我,hr面却是一把挂

Jump without refresh - detailed explanation of pushstate and replacestate methods in history
![[leetcode] a group of K flipped linked lists](/img/38/0b3cf215f49489bb5c3293471a818a.jpg)
[leetcode] a group of K flipped linked lists

Introduction and practice of QT tcp/udp network protocol (I) TCP communication

Understand the role of before and after Clearfixafter clear floating

AI 狂想|来这场大会,一起盘盘 AI 的新工具!

ABAP CDs realizes multi line field content splicing

Dinner a bang's Craft
随机推荐
Our understanding of the industrial Internet may be more out of the existing logic
【MATLAB】MATLAB图像处理基本操作
Battery control of QT widget (qpainter)
Task04: String
【图像处理】基于matlab GUI多功能图像处理系统【含Matlab源码 1876期】
[matlab] image segmentation
Flutter status management
Start with interpreting the code automatically generated by BDC, and explain the trial version of the program components of sapgui
20N10-ASEMI中小功率MOS管20N10
[error record] Android application security detection vulnerability repair (strandhogg vulnerability | set activity component android:taskaffinity= "")
【音乐】基于matlab演奏《过火》【含Matlab源码 1875期】
[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)
[matlab] image enhancement (power transformation, histogram specification processing method, smoothing and sharpening filtering)
switch case使用枚举类来比较
Task01: be familiar with the basic process of news recommendation system
QT database learning notes (II) QT operation SQLite database
Sparrowrecsys recurrence record
Dialog alertdialog, simpledialog, showmodalbottomsheet, showtoast shutter custom dialog
记录一下我的刷题实录
Task01: array