当前位置:网站首页>mysql函数获取全路径
mysql函数获取全路径
2022-06-30 17:46:00 【曹振华】
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边栏推荐
- com.alibaba.fastjson.JSONObject # toJSONString 消除循环引用
- AI首席架构师10-AICA-蓝翔 《飞桨框架设计与核心技术》
- Personally test the size of flutter after packaging APK, quite satisfied
- 链表中环的入口结点-链表专题
- rust配置国内源
- Can go struct in go question bank · 15 be compared?
- 领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
- Cobbler轻松上手
- 如何利用AI技术优化独立站客服系统?听听专家怎么说!
- Summary of methods for offline installation of chrome extensions in China
猜你喜欢

如何利用AI技术优化独立站客服系统?听听专家怎么说!

Deep learning compiler understanding

Merged binary tree of leetcode

详解单例模式

20220607跌破建议零售价,GPU市场正全面走向供过于求...

System integration project management engineer certification high frequency examination site: prepare project scope management plan

PC端微信多开

Electronic components bidding and purchasing Mall: optimize traditional purchasing business and speed up enterprise digital upgrading

链表中环的入口结点-链表专题

医院在线问诊小程序源码 互联网医院源码 智慧医院源码
随机推荐
Dlib library for face key point detection (openCV Implementation)
系统集成项目管理工程师认证高频考点:编制项目范围管理计划
视频内容生产与消费创新
Summary of methods for offline installation of chrome extensions in China
全栈代码测试覆盖率及用例发现系统的建设和实践
MRO工业品采购管理系统:赋能MRO企业采购各节点,构建数字化采购新体系
Countdowncatch and completabilefuture and cyclicbarrier
Where do the guests come from
PC端微信多开
Small program container technology to promote the operation efficiency of the park
一点比较有意思的模块
Compare the audio librosa library with the Mel spectrogram in the torchaudio library
20200525-生物技术-四川师范大学自考生物技术(本科)考试计划.txt
Sword finger offer 16 Integer power of numeric value
Swin-Transformer(2021-08)
屏幕显示技术进化史
一套十万级TPS的IM综合消息系统的架构实践与思考
System integration project management engineer certification high frequency examination site: prepare project scope management plan
20220528【聊聊假芯片】贪便宜往往吃大亏,盘点下那些假的内存卡和固态硬盘
Geoffrey Hinton:我的五十年深度学习生涯与研究心法