We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Bok Woon Chua • 10 months ago

if you used CROSS JOIN LATERAL, you can omit the `(JOIN) ... ON true` part right?

Scott Pierce • 10 months ago

Yes, I think so. I'm not sure how I got into the habit of ON true. Thanks for the reminder!

Pat • 1 year ago

Thank you! This was extremely helpful to me, as I needed to learn it for a Codewars exercise.

One thing that wasn't obvious to me: an INNER JOIN is implied here. If one wants the result set to contain records where the LATERAL JOINed sub query doesn't return anything, then use a LEFT JOIN LATERAL.

Scott Pierce • 1 year ago

I'm happy to hear this is still useful 4 years later. The Internet is great!