56,673
社区成员
发帖
与我相关
我的任务
分享
select SUM(t1Value)
from
(
select AVG(t1Value) as t1Value, MD5(GROUP_CONCAT(t2Value)) as keyword
from
(
select t2.CID as CID, t1.Value as t1Value, t2.Value as t2Value
from table1 as t1
join table2 as t2 on t2.CID=t1.ID
) as temp01
group by CID
) as temp02
group by keyword
;