Questions tagged [lateral-join]

The tag has no usage guidance.

2 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
0 answers
29 views

Greedily select rows that match against rules for each group

Suppose there's a product table with the following fields id (pk), category (index), name, picture, stock and we want to find ONE product in each of these category (1, 2, 3) that match at least one ...
Ian Chen's user avatar
  • 111
-1 votes
2 answers
22 views

LEFT JOIN LATERAL with a function result, how to prevent unnecessary function calls?

I have a costly function and it only provides relevant data when certain conditions are met. That data is inserted into the result through a LEFT JOIN LATERAL as shown below. As it works now, the ...
Björn Morén's user avatar