From: Dan Nelson Date: May 13 2003 10:29pm Subject: Re: count() List-Archive: http://lists.mysql.com/mysql/139655 Message-Id: <20030513222921.GA20982@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (May 13), Eric Anderson said: > I'm not sure if I'm just having problems thinking today but if you've > got a field: > > status enum('pending','active','cancelled') NOT NULL default 'pending' > > and you want to get a total of each the entries, is there any way to do > it in one pass, as opposed to: > > select count(*) from where status='pending' > select count(*) from
where status='active' > ... select status,count(*) from table group by status -- Dan Nelson dnelson@stripped