Thanks... But not Giving Expected result....
Try this
select v.code_number,v.vehicle_number,v.company_code,r.fc _valid_to,
i.next_due_date
from ((vehicledetails as v left outer join rtodetails as r
on v.code_number=r.code_number) left outer join insurancedetails as i
on v.code_number=i.code_number) Where v.code_number=’SMR5’
Thanks...
But its not giving Expected result....
Original Oracle query:
select v.code_number,v.vehicle_number,v.company_code,r.fc _valid_to,
i.next_due_date
from (vehicledetails v left outer join rtodetails r
on v.code_number=r.code_number AND v.code_number='SMR5'
left outer join insurancedetails i
on v.code_number=i.code_number);
Actually this ll give all the records from vehicledetails and give records from rtodetails which satisfies both condition(v.code_number=r.code_number AND v.code_number='SMR5') if condition not satisfied it ll return null for the column 'r.fc _valid_to'..(tat is 'r.fc _valid_to' contains value only for v.code_number='SMR5' for all other records it would b null) and also include records from insurancedetails which satisfies v.code_number=i.code_number
--------------------------------------------------------------------------
select v.code_number,v.vehicle_number,v.company_code,r.fc _valid_to,
i.next_due_date
from ((vehicledetails as v left outer join rtodetails as r
on v.code_number=r.code_number) left outer join insurancedetails as i
on v.code_number=i.code_number) Where v.code_number=’SMR5’
but this ll give all the records from vehicledetails and give records from rtodetails which satisfies v.code_number=r.code_number if condition not satisfied it ll return null for the column 'r.fc _valid_to'..(tat is 'r.fc _valid_to' contains value not only for v.code_number='SMR5') and also include records from insurancedetails which satisfies v.code_number=i.code_number then it ll filter the result for v.code_number='SMR5'(tat is it ll return only one row 'SMR5' only)