postgresql7.1 select distinct service_uri, service_version, apm_package_version__sortable_version_name(service_version) from apm_package_dependencies order by service_uri, apm_package_version__sortable_version_name(service_version)