top | item 39266026

(no title)

3rd3 | 2 years ago

Could you give an example?

discuss

order

ako|2 years ago

This will be useful if you have a table with some related history records, e.g., products with product price history, and you want to get the latest price. The lateral join would get all prices for the current product, sort them by date and then pick the top row.

3rd3|2 years ago

How does a lateral (cross) join compare to a window function in your example?

ses1984|2 years ago

Is a lateral join more efficient than just saying where product = current sort by date desc ?