SQL Server: Difference between PARTITION BY and GROUP BY

They’re used in different places. group by modifies the entire query, like: But partition by just works on a window function, like row_number: A group by normally reduces the number of rows returned by rolling them up and calculating averages or sums for each row. partition by does not affect the number of rows returned, … Read more

LEFT JOIN vs. LEFT OUTER JOIN in SQL Server

As per the documentation: FROM (Transact-SQL): The keyword OUTER is marked as optional (enclosed in square brackets). In this specific case, whether you specify OUTER or not makes no difference. Note that while the other elements of the join clause is also marked as optional, leaving them out will make a difference. For instance, the entire type-part of the JOIN clause is optional, in which case … Read more