A Database Error Occurred
Error Number: 1
Can't create/write to file '/var/lib/mysqltmp/#sql_13ed_0.MYI' (Errcode: 13)
select sql_no_cache p.id, p.product_grp_id, pg.products_active_qty, group_concat(tp.tag_id), sum(if(pgs.school_id=100 and tp.pos=1,32.32, 0)*if(pg.is_promote,1.05,1)+if(pgs2.school_id=100 and tp.pos=1,16.16, 0)*if(pg.is_promote,1.05,1)) weight_school, sum(if(pgs.school_id=100 and tp.pos=1,32.32, 0)*if(pg.is_promote,1.05,1)+if(pgs2.school_id=100 and tp.pos=1,16.16, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=1557,64/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=706,32/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=2195,16/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=3440,8/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=8360,4/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=8374,2/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=605,1/tp.pos, 0)*if(pg.is_promote,1.05,1)) weight from base_product p left join base_product_grp pg on pg.id=p.product_grp_id left join base_product_grp_school pgs on pgs.product_grp_id=pg.id and pgs.pos=1 left join base_product_grp_school pgs2 on pgs2.product_grp_id=pg.id and pgs2.pos=2 left join base_tag_ppg tp on tp.product_id=p.id where 1 and p.status='active' and pg.status='active' and pg.id!=1 and (tp.tag_id in (1557,706,2195,3440,8360,8374,605) or pgs.school_id=100) group by p.id order by weight desc, pg.date_start desc