Unknown column 'products.PRODUCT_ID' in 'field list'
SELECT SQL_CALC_FOUND_ROWS distinct(products.PRODUCT_ID),
products.PARENT_PRODUCT_ID,
substr(products.TITLE,1,10) AS TITLE,
substr(products.AUTHOR,1,10) AS AUTHOR,
products.SALES_RANK,
IFNULL(products.SALES_RANK, 'Z') as SALES_RANK_SORT,
products.stock_qty_sold,
products_store.store_qty_sold,
products.image_has_small as IMAGE_HAS_SMALL FROM products left join products_store on (products.product_id = products_store.product_id and products_store.store_id = 52) , products_category_fulltree WHERE products.store_id in (0, 52) AND products.STORETYPE_ID1 = 'Y' AND products.PRODUCT_CONFIG = 'CD' AND products.stock_available_flag in ('Y', 'P') AND (products.PRICE > 0 AND products.STATUS in ('A', 'B', 'C', 'M')) AND ( products.product_id not in (select product_term as product_id from store_product_censor where censorship_type = 'PID' and store_product_censor.store_id = 52) and products.isbn not in (select product_term as isbn from store_product_censor where censorship_type = 'PIS' and store_product_censor.store_id = 52) and products.upc not in (select product_term as upc from store_product_censor where censorship_type = 'PUP' and store_product_censor.store_id = 52) and products.ean not in (select product_term as ean from store_product_censor where censorship_type = 'PEA' and store_product_censor.store_id = 52) and products.author not in (select product_term as author from store_product_censor where censorship_type = 'AU' and store_product_censor.store_id = 52) and products.product_config not in (select product_term as product_config from store_product_censor where censorship_type = 'PC' and store_product_censor.store_id = 52) and products.publisher_name not in (select product_term as publisher_name from store_product_censor where censorship_type = 'PUB' and store_product_censor.store_id = 52) and products.publisher not in (select product_term as publisher from store_product_censor where censorship_type = 'PUC' and store_product_censor.store_id = 52) ) AND (products_category_fulltree.product_id = products.product_id and
products_category_fulltree.category_id = '67125' ) UNION
SELECT distinct(products.PRODUCT_ID),
products.PARENT_PRODUCT_ID,
substr(products.TITLE,1,10) AS TITLE,
substr(products.AUTHOR,1,10) AS AUTHOR,
products.SALES_RANK,
IFNULL(products.SALES_RANK, 'Z') as SALES_RANK_SORT,
products.stock_qty_sold,
products_store.store_qty_sold,
products.image_has_small as IMAGE_HAS_SMALL FROM products_category left join products_store on (products.product_id = products_store.product_id and products_store.store_id = 52) WHERE products.product_id = products_category.product_id and products_category.category_id = '67135' ORDER BY IMAGE_HAS_SMALL DESC, TITLE LIMIT 1000