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 8381533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:43:11+00:00 2026-06-09T16:43:11+00:00

From this table D_value ——- A B B C C C To display count

  • 0

From this table

D_value
-------
A 
B 
B 
C 
C 
C 

To display count D_Value into this table

A | B | C
---------
1 | 2 | 3
  • 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-09T16:43:12+00:00Added an answer on June 9, 2026 at 4:43 pm

    To get a single row, use this.

    SELECT
       COUNT(CASE WHEN D_Value = 'A' THEN 1 END) AS A,
       COUNT(CASE WHEN D_Value = 'B' THEN 1 END) AS B,
       COUNT(CASE WHEN D_Value = 'C' THEN 1 END) AS C
    FROM
       MyTable
    

    This works for a finite and fixed number of values to count

    If you do not know how many different values, then you need to do a simple aggregate and make a single row in the client code.

    SELECT D_value, COUNT(*) FROM MyTable GROUP BY D_value;
    

    However, this won’t give zero counts for values that do not exist. So you’d need a lookup table and LEFT JOIN. I won’t go there yet…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a table like this Generated from three database tables depends
I want to search the computer from this table and when i have stored
I have table with 300 000 records (MyISAM). I get record from this table
How to convert table from this format: Id | Data |Section ------------------------------------------ 1 |1AAA
From this link the author suggested: table.setWidth(100%, true); table.setColumnWidth(nameColumn, 35.0, Unit.PCT); table.setColumnWidth(addressColumn, 65.0, Unit.PCT);
I have tried create this table, but nothing I have tried works from FKs.
I have table with two columns (varchar from, varchar to). This table represents connections
if i apply a sql query statement to this table select * from context.tablename,
Normaly i would do a delete * from XXX but on this table thats
I have a HTML table as follows. I want retrieve row values from 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.