Hello again. I am rather (actually very) rusty when it comes to composing SQL these days. Can anyone spot the error here?
SELECT o.orderid, u.username, o.date, sum( p.price ) FROM order o, users u, order_item oi, product p WHERE o.userid = u.id AND o.orderid = oi.orderid AND oi.productid = p.productid AND o.status = 'new' ORDER BY o.date DESC , o.status, u.username GROUP BY o.orderid LIMIT 0 , 30 MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY o.orderid LIMIT 0, 30' at line 5 I've test it without the SUM() and GROUP BY so I know its my aggregate function that is doing it. Like I said - pretty rusty. -- View this message in context: http://www.nabble.com/Syntax-error-tf2938979.html#a8216800 Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]