select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1
 left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product
 left join ztv_projectsummary as t3 on t2.project=t3.project
 left join TABLE_PROJECT as t4 on t2.project=t4.id
 left join TABLE_PROGRAM as t5 on t1.program=t5.id
 where t1.deleted='0' and t4.deleted='0' and t4.type='project'
order by t5.`order` asc, t1.line desc, t1.`order` asc