Solved

MySql count question...

Posted on 2014-11-19
2
200 Views
Last Modified: 2014-11-23
Hi, I have a table as follows:

order #      order_status
1      Submit
2      Cancelled
3      In Progress
4      In Progress
5      In Progress
6      In Progress
7      Cancelled
8      Cancelled
9      Submit
10      Submit

The output I am looking for with a query is as follows:

order_type      Count
Submit              3
Cancelled      3
In Progress      4

Is this possible with just a mysql query?

Thank you,
A
0
Comment
Question by:aej1973
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40453176
SELECT count(order_status) as count, order_status from table 
GROUP BY order_status

Open in new window

0
 

Author Closing Comment

by:aej1973
ID: 40461345
Thank you.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now