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
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
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
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
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
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
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
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
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]
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
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
11 matches
Mail list logo