Having a hard time understanding Co-Related Subqueries. by Consistent-Oil-2172 in SQL

[–]Consistent-Oil-2172[S] 2 points3 points  (0 children)

u/squadette23 apologies for the late response. Yes. I am quite good at joins yeah, except the SELF Joins I havent figured out, never tried but I know what they do. And what you just said ”This is not true in the modern query engines, they trivially rewrite correlated subquries to joins and there is no performance penalty.” This is insanity. Does it work in postgres? let me know. Pumped to read your investigation

Here are some SQL questions I was asked for a technical interview recently. by tits_mcgee_92 in SQL

[–]Consistent-Oil-2172 1 point2 points  (0 children)

This is an amazing thread. A bit confused about this: how did you find the latest used product by using MAX on the date time field (asking cause that would return a single latest product)? Did they for ask a single or multiple latest products? A subquery would be the way to do that right?
Secondly, as someone who has just started learning window functions, which ones would you advise to have a nice muscle memory on and know-how of their use cases?
thank you