SELECT A.id ,A.Prospect_Id, GROUP_CONCAT(DISTINCT A.MYVIEW SEPARATOR ' , ') AS myview
FROM
(SELECT id, Prospect_Id, CONCAT(Current_Status, '(', count(Current_Status), ')') AS MYVIEW
FROM prospectdata1
GROUP BY Prospect_Id) A
GROUP BY A.prospect_id
HAVING myview REGEXP 'PHONE_FOLLOW_UP.*DUPLICATE'
输出:
预期产量:
1条答案
按热度按时间ct2axkht1#
您需要同时按潜在客户id和当前状态分组: