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

Bok Woon Chua • 2 years ago

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

Scott Pierce • 2 years ago

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

Pat • 3 years 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 • 3 years ago

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