Microsoft
Software
Hardware
Network
Question : MySQL Query Help
Hi there,
I need some assistance for a SQL query to show the results I would like to achieve but I am not sure how to get there.
I am using MySQL 5 with PHP, here is the data table structure.
id quantity color size
I've got several colors, sizes and quantities associated with each row and I'd like to pull a count of all the Large Black Shirts for example.
Example data could be as follows.
quantity color size
1 Red XL
2 Red S
1 Black XL
1 Blue XXXL
4 Green M
1 Red XL
etc...
For the example data, I would like the query to return
2 Red XL
2 Red S
1 Black XL
1 Blue XXXL
4 Green M
Thanks for the help!
Answer : MySQL Query Help
SELECT color, sizes, count(*) AS quantities
FROM <tablename>
GROUP BY color, sizes
Random Solutions
Excel Date Time format conversion yyyy-mmm-dd hh:mm:ss to mm/dd/yyyy hh:mm:ss
VB .NET 2005 Combine Two Tables on Primary Key and Display in DataGridView
V2P (Windows 2008)
How to avoid zero(s) in front of number(s) disappears in array
NTLDR is Missing on HP Proliant ML350 G4 with Windows 2003 SP2
FAX configuration in windows 2003 server with Gmail.
How do I verify Using SSIS if an XML file exist in the folder , change it's name and move ot to an SFTP if exist
SQL Encryption Key Error - SQL 2005
Is SQL Server 2005, 2008 free?
basic quadratic question