Select * from CRM_NegotiatedPrice Where CustomerCode ='客户编号' Order By BUsinessSubCode and BusinessSubCode = '经营子项编号'
Select * from CRM_NegotiatedPrice Where Id = '181DAC2C-558A-4E50-9085-64F6F9848955'
/*对比 */
Select CustomerCode + '-' + BusinessSubCode From CRM_NegotiatedPrice
Select Distinct CustomerCode + '-' + BusinessSubCode From CRM_NegotiatedPrice
/**查找*/
Select * from CRM_NegotiatedPrice Where CustomerCode ='客户编号' Order By BUsinessSubCode
/*处理*/
Delete CRM_NegotiatedPrice Where Id = '181DAC2C-558A-4E50-9085-64F6F9848955'
/*同步至总部*/
EXEC SYS_SyncPushTOBase_InsertAssQL
'
Delete CRM_NegotiatedPrice Where Id = ''181DAC2C-558A-4E50-9085-64F6F9848955''
',1000,10
-------/*查询客户编号不为以下编号的协议价格项目*/----------
Select * From CRM_NegotiatedPrice where CustomerCode Not In (
'客户编号1','客户编号2','客户编号3','客户编号4','客户编号5','客户编号6')
-------/*查询协议价格项目总数*/--------
Select Count(1) From CRM_NegotiatedPrice
-------/*每个客户含有的协议价格项目总数*/---------
Select CustomerCode,Count(1) As C From CRM_NegotiatedPrice Group by CustomerCode Order by CustomerCode
--------/*总部查询有协议价格的共享客户编号*/----------
Select Cus =(
Select ''''+ CustomerCode + ''''+',' From CRM_NegotiatedPrice Group by CustomerCode For XML Path('')
)