Error Message:
3065: Expression #1 of ORDER BY clause is not in SELECT list, references column 'hawghalt_cubecartlive.R.id' which is not in SELECT list; this is incompatible with DISTINCT
SQL:
SELECT DISTINCT I.* FROM `CubeCart_mod_related_prods` as R INNER JOIN `CubeCart_inventory` as I ON R.relatedId = I.productId INNER JOIN CubeCart_cats_idx AS CI ON CI.productId = I.productId INNER JOIN CubeCart_category AS C ON C.cat_id = CI.cat_id WHERE I.disabled = '0' AND C.cat_id > 0 AND C.hide = '0' AND (C.cat_desc != '##HIDDEN##' OR C.cat_desc IS NULL) AND R.productId = '821' ORDER BY R.id