当前位置:网站首页>MySQL function to get the full path
MySQL function to get the full path
2022-06-30 19:11:00 【Caozhenhua】
DROP FUNCTION IF EXISTS GetFullPath;
CREATE FUNCTION GetFullPath(InputDeptId char(36))
RETURNS VARCHAR(1000)
BEGIN
declare fullPath VARCHAR(1000) default '';
declare parentId char(36) default '';
declare num int default 0;
select concat(`Name`,'/',fullPath),UpperId into fullPath,parentId
from MDM_Dept
where DeptId=InputDeptId;
WHILE parentId<>'' DO
select count(1) into num from MDM_Dept where DeptId=parentId;
if num>0 then
select concat(`Name`,'/',fullPath),UpperId into fullPath,parentId
from MDM_Dept
where DeptId=parentId;
else
set parentId='';
end if;
END WHILE;
return fullPath;
END;
select GetFullPath(DeptId) fullPath,DeptId,UpperId,`Name` from MDM_Dept边栏推荐
- 3.10 haas506 2.0开发教程-example-TFT
- 服务器之间传文件夹,文件夹内容为空
- Personally test the size of flutter after packaging APK, quite satisfied
- 一点比较有意思的模块
- 屏幕显示技术进化史
- Neon optimization 2: arm optimization high frequency Instruction Summary
- 德国AgBB VoC有害物质测试
- Countdowncatch and completabilefuture and cyclicbarrier
- 基于 actix、async-graphql、rbatis、pgsql/mysql 构建 GraphQL 服务(4)-变更服务
- 20220607跌破建议零售价,GPU市场正全面走向供过于求...
猜你喜欢

When selecting smart speakers, do you prefer "smart" or "sound quality"? This article gives you the answer

The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?
![[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform](/img/56/9f3370eac60df182971607aa642dc2.jpg)
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform

Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills

Swin-transformer --relative positional Bias

AI chief architect 10-aica-lanxiang, propeller frame design and core technology

AI首席架构师10-AICA-蓝翔 《飞桨框架设计与核心技术》

MySQL transaction concurrency and mvcc mechanism

Hospital online consultation applet source code Internet hospital source code smart hospital source code

拓維信息使用 Rainbond 的雲原生落地實踐
随机推荐
云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
Huaxing Securities: kitex practice under the original hybrid Cloud Architecture
AI chief architect 10-aica-lanxiang, propeller frame design and core technology
C WinForm program interface optimization example
Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills
PyTorch学习(三)
ForkJoinPool
Electron 入门
20220607跌破建议零售价,GPU市场正全面走向供过于求...
Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
《被讨厌的勇气:“自我启发之父”阿德勒的哲学课》
torch.roll
Solution of enterprise supply chain system in medical industry: realize collaborative visualization of medical digital intelligent supply chain
Regular expressions (regular matching)
Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 1)
Opencv data type code table dtype
金融服务行业SaaS项目管理系统解决方案,助力企业挖掘更广阔的增长服务空间
slice
挖财账号开户安全吗?是靠谱的吗?