29What is a LATERAL join (CROSS APPLY), and when do you need it?▼hardSnowflakeAmazonMicrosoft1 replies◆ premiumA LATERAL join lets a FROM-clause subquery reference columns from the table before it, which a normal join cannot. The signal is recognizing the per-row use cases: top-N per group, table functions, unnesting arrays.Open full answer →
31What is the QUALIFY clause, and how does it simplify filtering on window functions?▼mediumSnowflakeDatabricksGoogle1 replies◆ premiumYou cannot filter on a window function in WHERE, so people wrap queries in subqueries. QUALIFY filters window results directly. The signal is knowing why WHERE cannot do it and writing top-N-per-group cleanly.Open full answer →