|
给个帐本查询SQL
select ood.SET_OF_BOOKS_ID SOB
,gl_sob.name SOB_NAME
,ood.BUSINESS_GROUP_ID BG
,hbg1.name BG_NAME
,ood.LEGAL_ENTITY LE
,hle.name LE_NAME
,ood.OPERATING_UNIT OU
,hou.name OU_NAME
,ood.organization_id ID
,ood.organization_code code
,ood.organization_name
from org_organization_definitions ood
,HR_ALL_ORGANIZATION_UNITS hou
,HR_ALL_ORGANIZATION_UNITS hle
,gl_sets_of_books gl_sob
,(select hbg.name,hbg.organization_id,hbg.business_group_id
from hr_all_organization_units hbg
where hbg.organization_id = hbg.business_group_id) hbg1
where ood.operating_unit = hou.organization_id
and ood.legal_entity = hle.organization_id
and gl_sob.set_of_books_id = ood.set_of_books_id
and hbg1.organization_id = ood.business_group_id
order by ood.business_group_id
,ood.set_of_books_id
,ood.legal_entity
,ood.operating_unit
,ood.organization_id |
|