RE: Count syntax

2007-09-28 Thread Beauford
Thanks - it works, but what does the 1 and 0 do in this - SUM(IF(supportertype = 'L', 1, 0)) -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: September 28, 2007 1:00 PM To: Beauford Cc: mysql@lists.mysql.com Subject: Re: Count syntax Beauford wrote: Hi

RE: Count syntax

2007-09-28 Thread Weston, Craig \(OFT\)
attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Michael Dykman [mailto:[EMAIL PROTECTED] Sent: Friday, September 28, 2007 1:36 PM To: Beauford Cc: mysql@lists.mysql.com Subject: Re: Count syntax 1 means

Re: Count syntax

2007-09-28 Thread Baron Schwartz
Beauford wrote: Hi, I have the following line of code and I keep getting wrong results from it. Can someone let me know what I'm doing wrong here. I just can't quite figure out the syntax that I need. select count(*) as numrows, count(supportertype) as leadcar from registrar where

Re: Count syntax

2007-09-28 Thread Michael Dykman
in this - SUM(IF(supportertype = 'L', 1, 0)) -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: September 28, 2007 1:00 PM To: Beauford Cc: mysql@lists.mysql.com Subject: Re: Count syntax Beauford wrote: Hi, I have the following line of code and I keep

Count syntax

2007-09-28 Thread Beauford
Hi, I have the following line of code and I keep getting wrong results from it. Can someone let me know what I'm doing wrong here. I just can't quite figure out the syntax that I need. select count(*) as numrows, count(supportertype) as leadcar from registrar where supportertype = 'L'; What I

RE: Count syntax

2007-09-28 Thread Beauford
Thanks to all. -Original Message- From: Michael Dykman [mailto:[EMAIL PROTECTED] Sent: September 28, 2007 1:36 PM To: Beauford Cc: mysql@lists.mysql.com Subject: Re: Count syntax 1 means that 1 will be added to the sum if the condition tests, otherwise 0 will be added