/*找出新的主键下冲突的协议价格*/
Select
*
From
CRM_NegotiatedPrice
Where
CustomerCode+'_'+ BusinessSubCode IN
(
Select
IndexString
From
(
Select
CustomerCode + '_'+ BusinessSubCode As IndexString,
COUNT(1) as CounterPrice
From CRM_NegotiatedPrice
Group By
CustomerCode + '_'+ BusinessSubCode
Having
COUNT(1)>1
) As TEMP
)
Order By
CustomerCode,BusinessSubCode