Thanks, I'll take a look.
[Edit]Checked and it did not work, got the same error again:
Code:
Column 'customer0_.name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Column 'customer0_.registered' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
It's caused by MS SQL Server I guess - it needs all fields to be grouped.
For example, this works:
SELECT cust.id, cust.name, count(orders) as ordercount
FROM customers cust LEFT JOIN orders ON orders.customer_id=cust.customer_id
GROUP BY cust.id, cust.name, count(orders)
ORDER BY cust.name
this does not
SELECT cust.*, count(orders) as ordercount
FROM customers cust LEFT JOIN orders ON orders.customer_id=cust.customer_id
GROUP BY cust.id
ORDER BY cust.name
(but same query works on MySQL ;))
So, is it bug or feature?