我在clickhouse中使用此查询:
SELECT DISTINCT
iap.EventId,
iap.Id as Title,
ole.RewardId,
ole.RewardGain,
if((ole.RewardType = 'Currency' and ole.RewardId = 'Cash'), ole.RewardGain, null) as Soft
FROM OpenLootboxEvent ole
ANY LEFT OUTER JOIN InAppPurchaseEvent iap
ON ole.EventSourceId = iap.EventId
WHERE iap.Id in ('superHotDeal');
此查询返回结果:
EventId Title RewardId Gain
---------------------------------------------------------------------
111 superHotDeal m3 5
111 superHotDeal m14 13
111 superHotDeal m20 25
111 superHotDeal Cash 282
111 superHotDeal Talent null
111 superHotDeal Hard null
每个“eventid”和“title”都有6种含义,其中“rewardid”可以有“m1”到“m26”的值,并且总是可以有“cash”、“talent”、“hard”值。
如何检索同一行中具有相同“eventid”和“title”的所有行?
这样地:
EventId Title man1 man1Cards man2 man2Cards man3 man3Cards Cash Talent Hard
----------------------------------------------------------------------------------------------
111 superHotDeal m3 5 m14 13 m20 25 282 null null
1条答案
按热度按时间mlmc2os51#
clickhouse中的数据透视