SELECT p.*,b.name AS brand_name, LENGTH( b.logo) AS logo_length,b.chart_url, pap.`price+-`, p.item_code FROM products p LEFT JOIN products_attributes pap ON pap.item_code=p.item_code LEFT JOIN brands b ON p.brand=b.ido JOIN categories_status cs ON cs.product_id=p.ido WHERE p.is_trouble=0 AND cs.category_id=75 AND (LOWER( CONCAT_WS( '', b.name, '_', p.title)) = 'power trip_pt100 boots') GROUP BY cs.product_id - Can't create/write to file '/tmp/#sql_430_0.MYI' (Errcode: 28)