Re: simpe select count question

2006-04-20 Thread Dan Buettner
Andras - If you create an additional table which contains all possible values for the order_status field, you can do this. Something like this: create table orderstatus ( statusname varchar(25) ); insert into orderstatus (statusname) values ('pending'), ('processing'), ('shipped'); Next yo

simpe select count question

2006-04-20 Thread Andras Kende
Hello, I would like merge this 3 query into a single one... SELECT COUNT(*) AS count FROM orders WHERE order_status = 'pending', SELECT COUNT(*) AS count FROM orders WHERE order_status = 'processing', SELECT COUNT(*) AS count FROM orders WHERE order_status = 'shipped', I could do : SELECT orde

Re: SELECT COUNT(*) question ...

2001-08-21 Thread shiuwaitai
. Then total number of records is the last sum-up. - Original Message - From: "G r e g L a w r i e" <[EMAIL PROTECTED]> To: "MySQL Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, August 21, 2001 2:15 PM Subject: SELECT COUNT(*) question ... > Howdy all, &

SELECT COUNT(*) question ...

2001-08-20 Thread G r e g L a w r i e
Howdy all, I have two tables as described further down below ... I use the following query to get the data I need ... sql = "SELECT tblTempConsolidation.*, tblCustomer.customerLibrary FROM tblCustomer, tblTempConsolidation WHERE tblCustomer.customerId = tblTempConsolidation.customerId AND tblTe