yanhechao 2021-12-28 16:21:57

mysql 查看叶子节点

select
	dept_id,
	dept_name as name ,
	parent_id as pid,
	case
		when exists(
		select
			1
		from
			sys_dept t2
		where
			a.dept_id = t2.parent_id) then 0
		else 1
	end as leaf
from
	sys_dept a

评论

trang chủ - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.1. UTC+08:00, 2024-11-14 14:27
浙ICP备14020137号-1 $bản đồ khách truy cập$