Hi Nicolas,
the trick of modify /libraries/joomla/database/exception/executing.php to print the query is very useful, trying this the query is:
SELECT *, SUM( case when o.order_currency_id = '1' then o.order_full_price end ) AS Total, COUNT(o.order_id) AS order_number FROM k4x6e_hikashop_order as o LEFT JOIN k4x6e_hikashop_user as a ON o.order_user_id=a.user_id LEFT JOIN k4x6e_users as u ON u.id=a.user_cms_id LEFT JOIN k4x6e_users AS b ON a.user_cms_id=b.id WHERE a.user_partner_activated=0 AND o.order_status IN ('shipped') AND a.user_id IS NOT NULL AND o.order_type='sale' GROUP BY a.user_id ORDER BY Total DESC LIMIT 10
If I try to execute this query in PhpMyAdmin I get #1062 - Duplicate entry error. How is it possible in a SELECT ?
Where is the problem ?
Many thanks
Luca