NC65客商涉及的表
--客商涉及到的表
--查询客户是否是供应商,即是否关联了供应商
select c.issupplier, c.name from bd_customer c where c.code = '020004474'
--查询供应商是否客户,即是否关联了客户
select s.iscustomer, s.name from bd_supplier s where s.code = '020004474'
--查询客商
select * from bd_cust_supplier where code = '020004474'
-- 备份
--select * into 新表名(即备份的表名) from 原表名 where ···(条件可加可不加,根据自己实际情况,不加就是全表数据备份)
select * into bd_customer_020004474 from bd_customer where code = '020004474';
select * into bd_supplier_020004474 from bd_customer where code = '020004474';
select * into bd_cust_supplier_020004474 from bd_customer where code = '020004474';
--更新客商属性
update bd_customer set issupplier = 'N' where code = '020004474';
update bd_supplier set iscustomer ='N' where code = '020004474';
--客商银行账号(根据客户或供应商主键查询对应的银行账号信息)
select * from bd_custbank where pk_cust = '1001A11000000009WPEK'