sql查询父级、子集
1,给出公司,查出公司的所有父级。
SELECT
ou,
cn,
company_id,
company_name,
parent_id,
new_order,
create_time,
is_company
FROM
(
select
@id as _id,
(select @id := parent_id from sys_new_org where ou in (_id)) as ids
from
sys_new_org t
where
原创
2020-11-03 08:30:59 ·
1071 阅读 ·
0 评论