Snowflake, Sql, Data Science, Data Engineering, Optimization.
based on the tables of TPC-H-SF10: select l_orderkey, sum(l_extendedprice*l_quantity), current_timestamp() from lineitem_10 join orders_10 on l_orderkey = o_orderkey group by 1 order by 2 desc limit 10 You can see that there’s a join there to ensure that every row in lineitem belongs to an order in