Ok ,thanks.  
I did notice that it effectively 'ignored' vendor and brought back a random
vendor.  In this case it ignored b and returned a but still used b's price
in the total.  Just something for me to remember I guess.  Thanks for the
response.

-----Original Message-----
From: Scott Noyes [mailto:[EMAIL PROTECTED] 
Sent: 11 August 2005 15:39
To: Ben Smith
Cc: mysql@lists.mysql.com
Subject: Re: HELP! sql command question for mysql


> It appears that you don't need to
> specify in the Group By clause all the columns that are referenced 
> without an aggregate function

True.

> For example this query would be invalid in MSSQL but
> valid in MySQL:
> 
> select id, vendor, sum(price)
> from p
> group by id

In this case, `vendor` would hold the vendor value from some random record
with the `id` indicated.  In practice, it's the first one as it appears in
the table, but that is not guaranteed.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System. For
more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


==============================================================================
For more information on Hargreaves Lansdown, visit our web site 
http://www.hargreaveslansdown.co.uk
IMPORTANT NOTICE
This email is intended solely for the recipient and is confidential and not for 
third party unauthorised distribution. If an addressing, or transmission, error 
has misdirected this email, please notify the author by replying to this email 
or notifying the system manager ([EMAIL PROTECTED]) if you are not the intended 
recipient you must not disclose, distribute, copy, print or rely on this email. 
Any opinions expressed in this document are those of the author and do not 
necessarily reflect the opinions of Hargreaves Lansdown. In addition, staff are 
not authorised to enter into any contract through email and therefore nothing 
contained herein should be construed as such. This email has been prepared 
using information believed by the author to be reliable and accurate but 
Hargreaves Lansdown makes no warranty as to the accuracy or completeness. In 
particular, Hargreaves Lansdown does not accept responsibility for any changes 
made to this email after it was sent. 
All group companies are Authorised and regulated by the Financial Services 
Authority and registered in England and the registered office is Kendal House, 
4 Brighton Mews, Clifton, Bristol, BS8 2NX. Telephone: 0117 9889880


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to