Gossamer Forum
Home : General : Databases and SQL :

Count 2 Columns in a Table

Quote Reply
Count 2 Columns in a Table
Hello:

I'm very new to MySQL and I need to count 2 columns in the same table... and display the totals.

1) How many students are registered in a class?
Column name: `register_status` varchar (10), Values= registered, pending, Null = Yes
Count (table.registered) as Enrolled
2) How many students completed a class?
Colum name: `completion_status` varchar (10), Values= Incomplete, Complete, Null = Yes
Count (table.complete) as Finished
I tried 2 counts in the table but I get the same totals on both columns.
Any help will be greatly apreciated!
Thank you.
Subject Author Views Date
Thread Count 2 Columns in a Table rafermo 9855 Oct 21, 2004, 6:20 PM
Thread Re: [rafermo] Count 2 Columns in a Table
Andy 9621 Oct 22, 2004, 2:22 AM
Thread Re: [Andy] Count 2 Columns in a Table
rafermo 9618 Oct 26, 2004, 9:11 PM
Post Re: [rafermo] Count 2 Columns in a Table
rafermo 9492 Nov 11, 2004, 10:50 AM