select s.specification_id k.contragent d.contragent_id d.contract d.dt_contract s.contract_id s.specification (select count(*) from specification_item i where i.specification_id=s.specification_id) as item_count (select count(*) from agreement a where a.contract_id=s.contract_id) as agreement_count from specification s left outer join contract d on (s.contract_id=d.contract_id) left outer join contragent k on (d.contragent_id=k.contragent_id) where 1=1 order by select count(*) as cnt from specification where 1=1 Спецификации
#specification# #item_count# #contract# #dateFormat(dt_contract,'DD.MM.YYYY')# #agreement_count# #contragent#
#gridFooter#