Question: I am using Postgres. Is this a correct way of doing two left joins? What I want is that the last left join should NOT

I am using Postgres.

Is this a correct way of doing two left joins? What I want is that the last left join should NOT have a "filtering" effect on the first left join, i.e. the result set with the two left joins should have at least an equal number of rows as only the first left join produces.

select a.uc_id, cr.imei,cr.points,log.start,log.end from routes cr left join assets a on a.imei = cr.imei left join logistics log on a.uc_id=log.uc_id

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!