如何重命名该值?它给了我 IN() 子句中最后选择的值。
SELECT cf_1573, SUM(counter) AS lyncs
FROM (
SELECT
cf_1573,
COUNT(cf_1573) AS counter
FROM vtiger_purchaseordercf
WHERE cf_1573
IN('Lync Front End (Std)','Lync Front End (Ent)','Lync Backend',
'Lync Edge','Lync SBA','Lync DNS Checks','Lync Certificate Checks')
GROUP BY cf_1573
) AS mslync
我有这个输出:
cf_1573 |lyncs
Lync Certificate Checks | 8
给sub-query
了我这个:
cf_1573 | counter
Lync Certificate Checks | 1
Lync DNS Check | 3
Lync Edge | 1
Lync SBA | 3
我希望输出显示“Data Lync”而不是“Lync 证书检查”,这是我的IN() clause
. 谢谢您的帮助。