22,209
社区成员
发帖
与我相关
我的任务
分享
SELECT * FROM [Department] as ta
where [ParentId]<>'' and
not exists (select 1 from [Department] where ta.[ParentId]=[DepartmentId])
delete FROM [Department] as ta
where [ParentId]<>'' and
not exists (select 1 from [Department] where ta.[ParentId]=[DepartmentId])