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

  • Home
  • SEARCH
  • 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 8757339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:16:41+00:00 2026-06-13T14:16:41+00:00

I have the below query Select case upper(device_model) when ‘IPHONE’ then ‘iOS – iPhone’

  • 0

I have the below query

Select 
case upper(device_model)
        when 'IPHONE' then 'iOS - iPhone'
        when 'IPAD' then 'iOS - iPad'
        when 'IPOD TOUCH' then 'iOS - iPod Touch'
        Else 'Android'
        End As Device_Model,
count(create_dtime) as Installs_Oct17_Oct30
From Player
Where Create_Dtime >= To_Date('2012-Oct-17','yyyy-mon-dd')
And Create_Dtime <= To_Date('2012-Oct-30','yyyy-mon-dd')
Group By Device_Model
Order By Device_Model

This spits out multiple rows of results that read “Android”….I would like there to be only 4 results rows, one for each case….so it comes out like this:

Device_Model     Installs_Oct17_Oct30
Android            987
iOS - iPad         12003
iOS - iPhone       8563
iOS- iPod Touch    3482
  • 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-13T14:16:42+00:00Added an answer on June 13, 2026 at 2:16 pm

    You are grouping by the field device_model, not your expression:

    Select 
    case upper(device_model)
        when 'IPHONE' then 'iOS - iPhone'
        when 'IPAD' then 'iOS - iPad'
        when 'IPOD TOUCH' then 'iOS - iPod Touch'
        Else 'Android'
        End As Device_Model,
    count(create_dtime) as Installs_Oct17_Oct30
    From Player
    Where Create_Dtime >= To_Date('2012-Oct-17','yyyy-mon-dd')
    And Create_Dtime <= To_Date('2012-Oct-30','yyyy-mon-dd')
    Group By
    case upper(device_model)
        when 'IPHONE' then 'iOS - iPhone'
        when 'IPAD' then 'iOS - iPad'
        when 'IPOD TOUCH' then 'iOS - iPod Touch'
        Else 'Android'
        End
    Order By Device_Model
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below query: select CASE WHEN rt.ROLE_TYPE_CD = 'SA' THEN ap.APPL_CD +
I have the below query in a postgresql database SELECT * FROM accounts where
I have a problem with the query below in postgres SELECT u.username,l.description,l.ip,SUBSTRING(l.createdate,0,11) as createdate,l.action
I have written this query for retrieving data from mysql as below select FeedbackCode,EMailID,FeedbackDetail,
I have a select query in MySQL shown below: This query executes and produces
I have one query that returns string value, my query is select case when
I have the below query: --Total DLs-- select sum(DLs) as DLs_Total From ( Select
I have below SQL query: SELECT * FROM ( SELECT S.aCol, S.bCol, S.cCol, ROW_NUMBER()
I have the following query SELECT * FROM( SELECT CASE WHEN TO_CHAR (ADD_MONTHS(:DATEINPUT, 1),
I have below query I am trying to show message 'No SubSource for this

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.