当前位置:网站首页>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 
边栏推荐
- 【行测】图形找规律类题目
- MySql的DDL和DML和DQL的基本语法
- MySql的DDL和DML和DQL的基本语法
- C language from introduction to soil -- super detailed summary of operators
- Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
- 第二部分—C语言提高篇_2. 内存分区
- Learning notes - distributed transaction theory
- 【PTA】团体程序设计天梯赛-练习集 L3题目总结(不全)
- 【Tips】创建版本控制项目的简单方法
- Traditional e-commerce dividends disappear, how to enter the new social e-commerce?
猜你喜欢

One book a day: machine learning and practice -- the road to the kaggle competition from scratch

Oauth2==SSO三种协议。Oauth2四种模式

AMD64 (x86_64) architecture ABI document: upper

传统电商红利消失,怎么进军新型社交电商?
![[leetcode] 11. Container with the most water - go language solution](/img/42/3a1839dd768a5f02dc2acb5bd66438.png)
[leetcode] 11. Container with the most water - go language solution

Hackingtool of security tools

MITRE ATT&CK超详细学习笔记-02(大量案例)

深度学习二三事-回顾那些经典卷积神经网络

Filter 过滤器

Kali安装pip以及pip换源
随机推荐
[tips] a simple method to create a version control project
django.db.utils.OperationalError: (2002, “Can‘t connect to local MySQL server through socket ‘/var/r
cookie_ session
Can recursion still play like this? Recursive implementation of minesweeping game
QoS quality of service three DiffServ Model message marking and PHB
定制 or 通用,中国 SaaS 未来发展趋势是什么?
[line test] Figure finding regular questions
Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
MySQL语句
fopen、fwrite、fseek、ftell、fread使用demo
JMeter notes 2 | JMeter principle and test plan elements
Pytorch deep learning practice lesson 10 / assignment (basic CNN)
论文阅读:HarDNet: A Low Memory Traffic Network
Decompress the anchor and enjoy 4000w+ playback, adding a new wind to the Kwai food track?
Development system selection route
Take you step by step to learn C (one)
RIoTBoard开发板系列笔记(九)—— buildroot 移植MatchBox
一个怎样的模式能让平台用户发生自助裂变?-链动2+1
C language from entry to Earth - array
MongoDB应用场景及选型(海量数据存储选型)