Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8788233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:06:29+00:00 2026-06-13T22:06:29+00:00

I have the following query: Select Player_Id, Pt_Credit As Total_Points From Player Where Trunc(Create_Dtime)

  • 0

I have the following query:

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

Which gives me this result:

Player_ID      TOTAL_POINTS
  23452         1500
  23494         1000
  30934         500

and so on. I want to group these player_ids results into groups like 0-300 points, 301-600 points, 601-900 points , and greater than 900 points…so it would look like this in the results:

Point_Level     Count(Player_ID)
0-300            532
301-600          444
601-900          669
>900             185
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:06:30+00:00Added an answer on June 13, 2026 at 10:06 pm

    Use CASE ... WHEN

    SELECT players.clasification, count(players.player_id)
    FROM (
        SELECT ROWNUM player_id, 
            (ROWNUM + 100) points,
            CASE
                WHEN (ROWNUM + 100) BETWEEN 0 AND 300 THEN
                    '0-300'
                WHEN (ROWNUM + 100) BETWEEN 301 AND 600 THEN
                    '301-600'
                WHEN (ROWNUM + 100) BETWEEN 601 AND 900 THEN
                    '601-900'
                ELSE
                    '> 900'
                END clasification
        FROM dual 
        CONNECT BY LEVEL <= 1000
    ) players 
    GROUP BY players.clasification;
    

    Or in your example:

    SELECT 
        count(player.player_id),
        player.clasification
    FROM (
        SELECT pl.*,
            CASE
                WHEN total_points BETWEEN 0 AND 300
                    THEN '0-300'
                WHEN total_points BETWEEN 301 AND 600
                    THEN '301-600'
                WHEN total_points BETWEEN 601 AND 900
                    THEN '601-900'
                ELSE '> 900'
            END clasification
        FROM player pl
        WHERE 
                TRUNC(Create_Dtime)  = TRUNC(SYSDATE) - 90
            AND TRUNC(Init_Dtime) >= To_Date('2012-sep-1', 'yyyy-mon-dd')
    
    )
        Player
    GROUP BY player.clasification;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following query : Player.select(Players.*, (SELECT COUNT(*) FROM Results WHERE Results.player_id
I have the following query in ORACLE SQL: Select Trunc(Cs.Create_Dtime), Count(Case When Cs.Cs_Listing_Id Like
I have the following queries: Select TRUNC(create_dtime) as Day, Count(Create_Dtime) As SinS_Tot From player_chkin_hist
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
I have the following query: SELECT item.`ID`, item.`Name`, item.`UnitCost`, item.`Price`, discount.`rate` FROM item INNER
I have the following query: SELECT * FROM table_name WHERE (col_1 LIKE '%$keyword%' OR
I have the following query: SELECT * FROM ( `teams` ) WHERE `name` =
I have the following query SELECT e.topicShortName, d.catalogFileID, e.topicID FROM catalog_topics a LEFT JOIN
I have the following query: SELECT COUNT(*) FROM FirstTable ft INNER JOIN SecondTable st
I have the following query: SELECT o.id,o.name FROM object o WHERE ( o.description LIKE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.