Query to get qualifying ProductIDs failed: Expression #1 of ORDER BY clause is not in SELECT list, references column 'www_productdb.PCD.NoImage' which is not in SELECT list; this is incompatible with DISTINCT
. SELECT DISTINCT P.ProductID FROM Product P INNER JOIN www_siteproductdb.SiteProductBVN SP ON P.ProductID = SP.ProductID INNER JOIN AttributeGroupSearch GS0 ON P.ProductID = GS0.ProductID INNER JOIN AttributeGroupSearch GS1 ON P.ProductID = GS1.ProductID INNER JOIN ProductConfigured PCD ON P.ProductID = PCD.ProductID WHERE P.Discontinue=0 && GS0.AttributeNVID =10771 && GS1.AttributeNVID =3101 && PCD.DefaultChoice=1 ORDER BY PCD.NoImage, P.SoldOut, P.Rank, P.RankUniqCust, P.ProductID LIMIT 0, 30