-----用友U9-SQL查询语句汇总---------

本文汇总了在用友U9系统中进行各种数据查询的SQL语句,包括组织、部门、业务员、存储地点、料品信息、供应商信息、客户信息、会计科目等多个方面的查询实例。这些查询涵盖了不同业务场景,例如获取有效组织、部门、业务员信息,查询存储地点及排除特定编码,获取料品的规格和名称,以及供应商的开户行信息等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

组织---
select * from (select a.ID,a.Code,b.Name from Base_Organization a
inner join Base_Organization_Trl b on a.ID=b.ID
where a.Code not in ('VPOrg','CPOrg',2001,2002) and a.Effective_IsEffective=1) a
---部门---
select * from (select a.ID,a.Code,b.Name from CBO_Department a
inner join CBO_Department_Trl b on a.ID=b.ID
where a.Org in (1001706090000058) and a.Effective_IsEffective=1) a
---业务员---
select * from (select a.ID,a.Code,b.Name from CBO_Operators a
inner join CBO_Operators_Trl b on a.ID=b.ID
where a.Effective_IsEffective=1 and a.Org in (1001706090000058) ) a
---存储地点----
--select * from CBO_Wh
select b.Code,a.Name,c.Name as Name1 from CBO_Wh_Trl a
inner join CBO_Wh b on a.ID=b.ID
inner join CBO_Operators_Trl c on b.Manager=c.ID
where b.Org=1001706090000058 and b.Effective_IsEffective=1
and b.Code not in ('K100101','K100102','K100103','K100201','K100104','K200801','K20601','K200700','K305002','K200802','K100202','K200400')
--料品信息-料号-名称-规格---------办公用品--------
select ID,Code,Name,SPECS from CBO_ItemMaster where Org=1001706090000058 and Effective_IsEffective=1 and Code like '9903%'
---资产卡片信息---
--select ID, * from FA_AssetCard_Trl
--select AssetCard ,* from FA_AssetTag

select a.ID,a.Code,a.Style,c.AssetName,d.CreateDate as 建卡日期,d.AccumulateUsedPeriods as 已使用年限月,
d.OriginalValue as 原值,d.NetValue as 净值,d.AccumulateDepreciation as 累积折旧 from FA_AssetTag a
inner join FA_AssetCard b on b.ID=a.AssetCard
inner join FA_AssetCard_Trl c on c.ID=b.ID
inner join FA_AssetCardAccountInformation d on b.DocNo=d.AssetCardCode

where b.Org=1001706090000058 and d.AssetCardCode='KP-2017040002' order by a.ID Desc
---供应商信息--开户行信息
--select TJOA,* from CBO_Supplier_Trl
select * from (select a.ID,a.Code,b.Name,c.Code as code1,d.Name as name1,a.DescFlexField_PrivateDescSeg1,a.DescFlexField_PrivateDescSeg2 from CBO_Supplier a
full join CBO_Supplier_Trl b on a.ID=b.ID
full join CBO_BankAccount c on a.ID=c.Supplier
full join CBO_BankAccount_Trl d on c.ID=d.ID
where a.Org=1001706090000058 and a.Effective_IsEffective=1) c
---供应商信息--开户行信息---联系人---联系人电话--立账条件-到期日
select * from (select a.ID,a.Code,b.Name,c.Code as code1,d.Name as name1,a.DescFlexField_PrivateDescSeg1,a.DescFlexField_PrivateDescSeg2,
e.Name as Name2,f.MaturityDateFirm_OffsetDays
from CBO_Supplier a
inner join CBO_Supplier_Trl b on a.ID=b.ID
inner join CBO_BankAccount c on a.ID=c.Supplier
inner join CBO_BankAccount_Trl d on c.ID=d.ID
inner join CBO_APConfirmTerm_Trl e on e.ID=a.APConfirmTerm--立账条件
inner join CBO_InstalmentTerm f on f.APConfirmTerm=e.ID--到期日
where a.Org=1001706090000058 and a.Effective_IsEffective=1) G

---供应商分类信息----
select * from (select a.ID,a.Code,b.Name,c.Code as code1,d.Name as name1 from CBO_Supplier a
inner join CBO_Supplier_Trl b on a.ID=b.ID
inner join CBO_BankAccount c on a.ID=c.Supplier
inner join CBO_BankAccount_Trl d on c.ID=d.ID
where a.Org=1001706090000058 and a.Effective_IsEffective=1) c
---客户信息--银行--联系人---地址
select * from (select a.ID,a.Code,b.Name,c.Code as code1,d.Name as name1,a.DescFlexField_PrivateDescSeg1,a.DescFlexField_PrivateDescSeg2 from CBO_Customer a
inner join CBO_Customer_Trl b on a.ID=b.ID
inner join CBO_CustomerBankAccount c on a.ID=c.Customer
inner join CBO_CustomerBankAccount_Trl d on c.ID=d.ID
where a.Org=1001706090000058 and a.Effective_IsEffective=1) c
---物料信息--编码-料号-名称-MPN-规格-描述-单位---
select a.ID,a.Code,a.Name,a.DescFlexField_PrivateDescSeg1,a.SPECS,b.Name,c.Description as 描述 from CBO_ItemMaster a
inner join Base_UOM_Trl b on a.InventorySecondUOM=b.ID
inner join CBO_ItemMaster_Trl c on a.ID=c.ID
where Org=1001706090000058 and Effective_IsEffective=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值