There are different versions of si.version_number. e.g.
version_number=1
version_number=2
version_number=3
I need to retrieve the data having the maximum version number.
I know my query is somewhat wrong. Can anyone help me with this? Thanks.
select si.point_id,si.ti_region_sur,si.phone_number,si.ti_service_instance_id,si.version_number
from
ti_invoice_account ia, ti_product_agreement pa, ti_asset_agreement aa, ti_service_instance si
where
si.version_number=max(si.version_number) and
ia.ti_invoice_account_sur=pa.ti_invoice_account_sur and
pa.ti_product_agreement_sur=aa.ti_product_agreement_sur and
aa.ti_service_instance_id=si.ti_service_instance_id and
ia.ti_invoice_account_sur=4897;