SELECT
id,
Prospect_Id,
GROUP_CONCAT(Current_Status ORDER BY id) AS myview,
GROUP_CONCAT(myview) AS myview1
FROM prospectdata1
GROUP BY Prospect_Id
HAVING myview REGEXP 'PHONE_FOLLOW_UP.*DUPLICATE'
我想在第二组concat中显示myview数据。。
SELECT
id,
Prospect_Id,
GROUP_CONCAT(Current_Status ORDER BY id) AS myview,
GROUP_CONCAT(myview) AS myview1
FROM prospectdata1
GROUP BY Prospect_Id
HAVING myview REGEXP 'PHONE_FOLLOW_UP.*DUPLICATE'
我想在第二组concat中显示myview数据。。
1条答案
按热度按时间piah890a1#
您可以使用子查询,因为此时列别名对于所选的不同列不可见。我假设你需要第二级的聚合
Prospect_Id
唯一标识行,因为您不是按id
.使用子查询: