Select * from((
select VGUID,ODESC as DESC0,ODESCCHS as DESC1,PGUID,OID as ZORDER from CSORGA_1 where VGUID in (
select cmpnam from csempl_1 where dcno='{SYS:DCNO}' union all
select DCDEPT from csempl_1 where dcno='{SYS:DCNO}' ) )union (
select VGUID,DCNO+'-'+DCNAME as DESC0,DCNO+'-'+DCNAMECHS as DESC1,DCDEPT as PGUID,DCNO as ZORDER FROM CSEMPL_1 where DCDEPT in (
select DCDEPT from csempl_1 where dcno='{SYS:DCNO}')))A ORDER BY ZORDER
when we use the landa system ,some of the fields is used by the Tree control ,when the use the tree control to select the relation person ,the want filter the person which in the same department ,so ,when depend on the user number,bring the CMPNAM and the DCDEPT from the CSORGA_1 and DCDEPT from the CSEMPL_1 .is will show the result which you need ~!
本文介绍了一种SQL查询方法,用于从两个不同的表中筛选出特定部门内的人员及其相关信息。此查询结合了多个条件和子查询,以确保返回的数据符合用户当前部门的需求。

被折叠的 条评论
为什么被折叠?



