Re: Why this query doesn't group the email addresses?

2004-07-14 Thread Harald Fuchs
In article [EMAIL PROTECTED], Justin Swanhart [EMAIL PROTECTED] writes: Where is the implicit group? The 'order by' shouldn't effect how things are grouped. On MySQL 4.0.17: Wow. I wasn't aware. Is that expected behavior? Other databases (Oracle) generate an error when you include

Why this query doesn't group the email addresses?

2004-07-13 Thread Aaron Wolski
Hey all, Got this query: SELECT first,last,email FROM CustomerTable AS t1, OrderTable AS t2, CartTable AS t3 WHERE t2.cart_id=t3.cart_id AND t1.id=t2.customer_index AND t3.submitted='1' AND t3.product_index='1' AND t3.quantity0 GROUP BY t1.email ORDER BY t1.first,t1.last For some strange reason

RE: Why this query doesn't group the email addresses?

2004-07-13 Thread Victor Pendleton
Were the records exactly the same? -Original Message- From: Aaron Wolski To: [EMAIL PROTECTED] Sent: 7/13/04 10:04 AM Subject: Why this query doesn't group the email addresses? Hey all, Got this query: SELECT first,last,email FROM CustomerTable AS t1, OrderTable AS t2, CartTable AS t3

RE: Why this query doesn't group the email addresses?

2004-07-13 Thread Aaron Wolski
Yes sir. Exactly! A -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: July 13, 2004 11:15 AM To: 'Aaron Wolski '; '[EMAIL PROTECTED] ' Subject: RE: Why this query doesn't group the email addresses? Were the records exactly the same? -Original

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Wesley Furgiuele
What type of field is the email field? Wes On Jul 13, 2004, at 11:04 AM, Aaron Wolski wrote: Hey all, Got this query: SELECT first,last,email FROM CustomerTable AS t1, OrderTable AS t2, CartTable AS t3 WHERE t2.cart_id=t3.cart_id AND t1.id=t2.customer_index AND t3.submitted='1' AND

RE: Why this query doesn't group the email addresses?

2004-07-13 Thread Aaron Wolski
varchar, sir. -Original Message- From: Wesley Furgiuele [mailto:[EMAIL PROTECTED] Sent: July 13, 2004 1:14 PM To: Aaron Wolski Cc: [EMAIL PROTECTED] Subject: Re: Why this query doesn't group the email addresses? What type of field is the email field? Wes On Jul 13, 2004

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Justin Swanhart
You are doing an implicit group by of first, last as well as your explicit group by of email. So you could have two records with the same e-mail address generate two records with your group by Justin Time [EMAIL PROTECTED] Justin Credible [EMAIL PROTECTED] --DUPE-- Case differences

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Wesley Furgiuele
Justin: Interesting. So, if GROUP BY t1.email doesn't group simply by t1.email, then how would the query be written to accomplish that? And how is it occurring that Aaron is implicitly grouping by email, first, last instead of just grouping by email? Is it because of the ORDER BY clause? Wes

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Garth Webb
On Tue, 2004-07-13 at 11:13, Justin Swanhart wrote: You are doing an implicit group by of first, last as well as your explicit group by of email. So you could have two records with the same e-mail address generate two records with your group by Justin Time [EMAIL PROTECTED]

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Justin Swanhart
Where is the implicit group? The 'order by' shouldn't effect how things are grouped. On MySQL 4.0.17: Wow. I wasn't aware. Is that expected behavior? Other databases (Oracle) generate an error when you include columns in the select list that aren't in a group by, or they do an implicit

Re: Why this query doesn't group the email addresses?

2004-07-13 Thread Garth Webb
On Tue, 2004-07-13 at 13:51, Justin Swanhart wrote: Where is the implicit group? The 'order by' shouldn't effect how things are grouped. On MySQL 4.0.17: Wow. I wasn't aware. Is that expected behavior? Yup, check out: http://dev.mysql.com/doc/mysql/en/GROUP-BY-hidden-fields.html