我有以下查询:
Select Player_Id,
Pt_Credit As Total_Points
From Player
Where Trunc(Create_Dtime) = Trunc(Sysdate) - 90
And Trunc(Init_Dtime) >= To_Date('2012-sep-1','yyyy-mon-dd')
Order by Total_Points Desc
这给了我这个结果:
Player_ID TOTAL_POINTS
23452 1500
23494 1000
30934 500
等等。我想将这些 player_ids 结果分组为 0-300 点、301-600 点、601-900 点和大于 900 点的组......所以结果看起来像这样:
Point_Level Count(Player_ID)
0-300 532
301-600 444
601-900 669
>900 185