当前位置:网站首页>MySQL queries all parents of the current node
MySQL queries all parents of the current node
2022-07-24 07:22:00 【Ink seeking Roy】
SELECT t2.file_id,t2.ffile_id
FROM
(
SELECT
@r AS _id,
( SELECT @r := xxx.file_info.ffile_id FROM xxx.file_info WHERE xxx.file_info.file_id = _id ) AS ffile_id,
@s := @s + 1 AS sort
FROM
( SELECT @r := 8, @s := 0 ) temp,
xxx.file_info
WHERE
@r > 0
) t1
JOIN xxx.file_info t2 ON t1._id = t2.file_id ;
notes : xxx.file_info.ffile_id It's a parent id,xxx.file_info Is the name of the table ,xxx.file_info.file_id At present id
8 It is the present. id, Replace the variable 
边栏推荐
- 【LeetCode】11. 盛最多水的容器 - Go 语言题解
- [word] how to generate the index directory on the left
- 【时序逻辑电路】——寄存器
- [PTA] group programming ladder competition - Summary of exercises L3 (incomplete)
- [steering wheel] the super favorite idea efficiency artifact save actions is uninstalled
- Bookkeeping app: xiaoha bookkeeping 1 - production of welcome page
- Do you really know the judgement sentence?
- 项目上线就炸,这谁受得了
- AMD64(x86_64)架构abi文档:上
- UNI-APP_小程序或h5页面背景音乐的播放与暂停
猜你喜欢

Pytorch deep learning practice lesson 10 / assignment (basic CNN)

Variables and data types (03)

编译与调试(gcc,g++,gdb)

项目上线就炸,这谁受得了

第一部分—C语言基础篇_11. 综合项目-贪吃蛇

Part I - Fundamentals of C language_ 11. Comprehensive project - greedy snake

全国职业院校技能大赛网络安全B模块 缓冲区溢出漏洞

记账APP:小哈记账2——注册页面的制作

QoS quality of service 4 traffic regulation of QoS boundary behavior

Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
随机推荐
[leetcode simple] 20. Valid brackets stack
Nacos的高级部分
cookie_session
Wild pointer, null pointer, invalid pointer
My creation anniversary
mysql查询当前节点的所有父级
MongoDB应用场景及选型(海量数据存储选型)
Use dichotomy to find specific values from the array
Traditional e-commerce dividends disappear, how to enter the new social e-commerce?
全国职业院校技能大赛网络安全B模块 缓冲区溢出漏洞
php链路日志方案
Variables and data types (03)
Part II - C language improvement_ 2. Memory partition
Basic syntax of MySQL DDL and DML and DQL
File upload and download demo
Stm32h750vbt6 drives programmable gain amplifier module pga113 -- Hal Library Based on cubemx
17. What is the situation of using ArrayList or LinkedList?
给一个字符串 ① 请统计出其中每一个字母出现的次数② 请打印出字母次数最多的那一对
Can recursion still play like this? Recursive implementation of minesweeping game
[leetcode] 444. Sequence reconstruction