select $select from hlyun_cost_vouchers left join (select VoucherId,BillId from hlyun_cost_index_vouchers_bills group by VoucherId) as hlyun_cost_index_vouchers_bills on hlyun_cost_index_vouchers_bills.VoucherId=hlyun_cost_vouchers.ID where $sql
select $select from hlyun_cost_vouchers left join (select VoucherId,BillId from hlyun_cost_index_vouchers_bills group by VoucherId) as hlyun_cost_index_vouchers_bills on hlyun_cost_index_vouchers_bills.VoucherId=hlyun_cost_vouchers.ID where $sql