SELECT xcart_products.*, xcart_products.avail AS avail, MIN(xcart_pricing.price) as price , xcart_quick_flags.*, xcart_quick_prices.variantid, xcart_quick_prices.priceid, xcart_clean_urls.clean_url, xcart_clean_urls.mtime , xcart_products_lng_en.* FROM xcart_pricing INNER JOIN xcart_products ON xcart_pricing.productid = xcart_products.productid AND xcart_products.productid='270139' INNER JOIN xcart_quick_flags ON xcart_products.productid = xcart_quick_flags.productid INNER JOIN xcart_quick_prices ON xcart_products.productid = xcart_quick_prices.productid AND xcart_quick_prices.membershipid = '0' INNER JOIN xcart_products_lng_en ON xcart_products_lng_en.productid=xcart_products.productid LEFT JOIN xcart_product_memberships ON xcart_product_memberships.productid = xcart_products.productid LEFT JOIN xcart_clean_urls ON xcart_clean_urls.resource_type = 'P' AND xcart_clean_urls.resource_id = xcart_products.productid WHERE 1 AND xcart_products.product_type <> 'C' AND xcart_products.forsale <> 'B' AND (xcart_product_memberships.membershipid = '0' OR xcart_product_memberships.membershipid IS NULL) AND xcart_quick_prices.membershipid = '0' AND xcart_quick_prices.priceid = xcart_pricing.priceid GROUP BY xcart_products.productid ORDER BY NULL