MySQL Forums
Forum List  »  Newbie

counting rows
Posted by: Michael Temeschinko
Date: June 08, 2005 02:19PM

Hello forum,

I have a table containing

Article | State
-------------------
1 | 10
2 | 10
1 | 5
1 | 5

and I want to count all Articles in one row with the different states

SELECT Article, COUNT(State=10) AS Ordered, COUNT(State=5) AS Free FROM...... GROUP....



but this SQL doesn't work (on my Server 4.0.20) I don't know if it work above but in the docu I can read somthing COUNT(expr) my be it works in 4.1

but is there another way that works wit 4.0.20?

greetings from Germany
Micha

Options: ReplyQuote


Subject
Written By
Posted
counting rows
June 08, 2005 02:19PM
June 08, 2005 02:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.