参考下面的方法,还望采纳:
可以删除条件语句 "where PLAYER INDEX = 2964060"
select playerIndex, count(player id) as advertisingUpCount, count(valid status=1 or null) as advertisingValidCount
from t_player_advertising_log_20230131
group by playerIndex;
可以使用分组group by呐,即将 where 那里换成 group by (PLAYER_INDEX),然后就可以根据PLAYER_INDEX来统计相应数据,结果会产生多条图中记录。
不知道你这个问题是否已经解决, 如果还没有解决的话: