MySQL Forums
Forum List  »  Newbie

error 1064 when using DISTINCT
Posted by: Dave
Date: April 24, 2005 01:30AM

Alright, I am working through a tutorial for SQL that demonstrates the DISTINCT function. I copy the example into MySQL word for word and I get error 1064. I'm stumped and I can't find the syntax error. I'm sure its obvious but I don't have the expertise to find it! I'm running MySQL 4.1 on a laptop runnng Fedora Core 3. Below is the exact code and error message. Any help would be greatly apprectated, thanks!

mysql> SELECT AVG(DISTINCT prod_price) AS avg_price
-> FROM Products
-> WHERE vend_id='DLL01';
ERROR 1064: You have an error in your SQL syntax near 'DISTINCT prod_price) AS avg_price
FROM Products
WHERE vend_id='DLL01'' at line 1

Options: ReplyQuote


Subject
Written By
Posted
error 1064 when using DISTINCT
April 24, 2005 01:30AM
April 24, 2005 09:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.