INVALID SQL: 1054 : Unknown column 'pg' in 'where clause' SQL QUERY FAILURE:
SELECT
od2.productid,
SUM(od2.amount) AS total
FROM
xcart_order_details AS od1
LEFT JOIN xcart_order_details AS od2 ON od2.orderid = od1.orderid
WHERE
od1.productid = 3214-pg-1 AND
od2.productid != 3214-pg-1
GROUP BY
od2.productid
ORDER BY
total DESC