我在下面有两个查询,它们都来自同一个“玩家”表。我想将查询 1 除以查询 2 以获得相关百分比。我对更详细的 SQL 查询以及在论坛上发帖相对较新……但如果您对如何将其结合以获得相关百分比结果有任何建议,请告诉我。
1
Select
sysdate,sum(Count(init_dtime))
From Player p
Where
Trunc(Init_Dtime) > Trunc(Sysdate) - 7
And Trunc(Create_Dtime) >= To_Date('2012-mar-01','yyyy-mon-dd')
and trunc(create_dtime) < to_date('2015-sep-9','yyyy-mon-dd')
Group By Trunc(Init_Dtime)
Order By Trunc(Init_Dtime) Asc
2
Select
Sum(Count(Create_Dtime))
From Player P
where
Trunc(Create_Dtime) >= To_Date('2012-mar-01','yyyy-mon-dd')
And Trunc(Create_Dtime) < To_Date('2015-sep-9','yyyy-mon-dd')
Group By Trunc(create_Dtime)
Order By Trunc(create_Dtime) Asc