Ah!  ORDER BY  after GROUP by - now it works:

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'
GROUP BY o.orderid
ORDER BY o.date DESC , o.status, u.username
LIMIT 0 , 30 
-- 
View this message in context: 
http://www.nabble.com/Syntax-error-tf2938979.html#a8216881
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]

Reply via email to