私はこれらの2つの別々のクエリを持っています:
クエリ1
select '2013-03-03' As "Week_Of",
count(player_id) as cohort_size
from player
where trunc(create_dtime) > To_Date('2013-Mar-03','yyyy-mon-dd')-7
and trunc(create_dtime) <= To_Date('2013-Mar-03','yyyy-mon-dd')
and world_flag != '1'
;
どの出力:
Week_of Cohort_size
2013-03-03 18183
クエリ2
select '2013-03-03' As "Week_Of",
count(player_id) as Day_0_Ret
from player
where trunc(init_dtime)-trunc(create_dtime) >= 0
and trunc(create_dtime) > To_Date('2013-Mar-03','yyyy-mon-dd')-7
and trunc(create_dtime) <= To_Date('2013-Mar-03','yyyy-mon-dd')
and world_flag != '1'
;
どの出力:
Week_of Day_0_Ret
2013-03-03 15684
これらの2つのクエリをまとめたいので、次の1つのクエリを出力します。
Week_of Cohort_Size Day_0_Ret
2013-03-03 18183 15684