SELECT so.id AS "Licence ref", o.long_name AS "Organisation", co.name AS "Country", full_name AS "Contact name", software_type.name AS "Software", order_date as "Date"
FROM software_order so , software_order_item si, organisation o, person p, country co, software_type
WHERE si.software_order_id=so.id
AND si.software_type_id= software_type.id
AND (software_type_id='129' OR software_type_id='137' OR software_type_id='139')
AND so.organisation_id=o.id
AND so.orderer_id=p.id
AND o.country_code=co.code
ORDER BY o.country_code ASC |