sql 根据客户需用 调价查询字段
时间:2021-07-01 10:21:17
帮助过:15人阅读
@vcFieldName VARCHAR(
100)
= ‘nMerchantId,nUserId,dmMoney‘
SELECT nMerchantId, nUserId, dmMoney,
CASE WHEN CHARINDEX(
‘nMerchantId‘,
@vcFieldName)
> 0 THEN nMerchantId
ELSE 0
END + CASE WHEN CHARINDEX(
‘nUserId‘,
@vcFieldName)
> 0 THEN nUserId
ELSE 0
END + CASE WHEN CHARINDEX(
‘dmMoney‘,
@vcFieldName)
> 0 THEN dmMoney
ELSE 0
END AS dmTotal
FROM GM.CRM_Customer
sql 根据客户需用 调价查询字段
标签:字段 log end color ant field custom pre code