Re: [PHP-DB] counting multiple columns based on different values

2002-02-16 Thread DL Neil
John, Don't tell me I asked you to do a SUM() without a GROUP BY clause!!!??? Someone pass me a hammer! - guess I was so focused on getting around that incompatible pair of GROUP BYs in the first attempt. It is so much easier when I can 'play' with the data in MySQL-Front to 'debug'! Rather th

Re: [PHP-DB] counting multiple columns based on different values

2002-02-16 Thread John Hawkins
DL, I ran the query exactly as you had sent it and ran into the same error where it talked about mixing counts without a group clause. So, I added a quick "group by clientname" and ran it again One word "PERFECTION". I can't thank you enough. This is now a blistering fast query that pro

Re: [PHP-DB] counting multiple columns based on different values

2002-02-16 Thread DL Neil
John, > > I'm gonna go out on a limb and guess that I'm missing > > something obvious (and easy) because this sure seems > > like it should be able to be done. > > > > Here's the issue: I need to pull the client name and > > ID out of one table and then, count the records in a > > different table

Re: [PHP-DB] counting multiple columns based on different values

2002-02-15 Thread John Hawkins
]> >Sent: Thursday, February 14, 2002 9:36 AM >Subject: Re: [PHP-DB] counting multiple columns based on different >values > > >> This should do the trick (untested): >> >> SELECT ClientName, Count(*) FROM Clients LEFT JOIN Ratings ON >Clients.ID = >>

Re: [PHP-DB] counting multiple columns based on different values

2002-02-14 Thread Peter Vervoorn
Message - From: "Peter Vervoorn" <[EMAIL PROTECTED]> To: "php-db list" <[EMAIL PROTECTED]> Sent: Thursday, February 14, 2002 9:36 AM Subject: Re: [PHP-DB] counting multiple columns based on different values > This should do the trick (untested): > >

Re: [PHP-DB] counting multiple columns based on different values

2002-02-14 Thread DL Neil
John, > I'm gonna go out on a limb and guess that I'm missing > something obvious (and easy) because this sure seems > like it should be able to be done. > > Here's the issue: I need to pull the client name and > ID out of one table and then, count the records in a > different table (called ratin

Re: [PHP-DB] counting multiple columns based on different values

2002-02-14 Thread Peter Vervoorn
;John Hawkins" <[EMAIL PROTECTED]> To: "php-db list" <[EMAIL PROTECTED]> Sent: Thursday, February 14, 2002 3:11 AM Subject: [PHP-DB] counting multiple columns based on different values > I'm gonna go out on a limb and guess that I'm missing > something o

Re: [PHP-DB] counting multiple columns based on different values

2002-02-13 Thread Jason Cox
be a better way but it doesn't. Jason Cox - Original Message - From: "John Hawkins" <[EMAIL PROTECTED]> To: "Jason Cox" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, February 13, 2002 9:08 PM Subject: Re: [PHP-DB] counting multiple

Re: [PHP-DB] counting multiple columns based on different values

2002-02-13 Thread John Hawkins
AND > ratings3.status = '3' > GROUP BY clients.clientname; > > That should do the trick. Enjoy!! > > Jason Cox > > - Original Message - > From: "John Hawkins" <[EMAIL PROTECTED]> > To: "php-db list" <[EMAIL PROTECTED]&

Re: [PHP-DB] counting multiple columns based on different values

2002-02-13 Thread John Hawkins
s.clientname; > > That should do the trick. Enjoy!! > > Jason Cox > > - Original Message - > From: "John Hawkins" <[EMAIL PROTECTED]> > To: "php-db list" <[EMAIL PROTECTED]> > Sent: Wednesday, February 13, 2002 7:11 PM > Subject

Re: [PHP-DB] counting multiple columns based on different values

2002-02-13 Thread Jason Cox
: Wednesday, February 13, 2002 7:11 PM Subject: [PHP-DB] counting multiple columns based on different values > I'm gonna go out on a limb and guess that I'm missing > something obvious (and easy) because this sure seems > like it should be able to be done. > > Here&#

[PHP-DB] counting multiple columns based on different values

2002-02-13 Thread John Hawkins
I'm gonna go out on a limb and guess that I'm missing something obvious (and easy) because this sure seems like it should be able to be done. Here's the issue: I need to pull the client name and ID out of one table and then, count the records in a different table (called ratings) that match two d