About 381,000 results
Open links in new tab
  1. sql - Get top 1 row of each group - Stack Overflow

    Jul 27, 2011 · The column/columns after partition by defines how SQL Server groups up the data. Within each group, the rows will be sorted based on the order by columns. Once sorted, the …

  2. sql - Partition by using multiple case statements - Stack Overflow

    Jun 11, 2016 · I am attempting to dedupe records in a database using partition by clause This is the query i run in order to dedupe. It ranks the records that are the most populated and keeps …

  3. How to get the max row number per group/partition in SQL Server?

    How to get the max row number per group/partition in SQL Server? Asked 14 years, 9 months ago Modified 2 years, 10 months ago Viewed 152k times

  4. sql server - How does one Remove a Partition from a Table

    Apr 18, 2019 · I have managed to add a Partition to a Table (Logs) but needed to create a Rollback script in case it needs to be removed. Unfortunately, this has now failed and Logs …

  5. sql - How to Partition a Table by Month ("Both" YEAR & MONTH) …

    Aug 11, 2015 · I'm trying to Partition a Table by both Year and Month. The Column through which I'll partition is a datetime type column with an ISO Format ('20150110', 20150202', etc).

  6. Partition Function COUNT () OVER possible using DISTINCT

    Jun 26, 2012 · Do I use a more traditional method such as a correlated subquery? Looking into this a bit further, maybe these OVER functions work differently to Oracle in the way that they …

  7. What is the difference between PARTITION BY and GROUP BY

    partition by doesn't actually roll up the data. It allows you to reset something on a per group basis. For example, you can get an ordinal column within a group by partitioning on the grouping field …

  8. SQL Server - Partitioning a Table by Day of Month

    Mar 26, 2019 · Because SQL Server cannot optimize a query of the form WHERE d >= '20190326' AND d < '20190327' for partition elimination if the table isn't actually partitioned by …

  9. SQL - use inside 'where' 'over (partition by...)'

    Jan 9, 2019 · How can I get results from a sql query in which the title runs more than once? This shows the correct values for 'PPP' but filtering AND (count(*) over (partition by TITLE)) > 1 …

  10. sql server - SQL row_number () with conditions - Stack Overflow

    Apr 6, 2015 · I think you can do this with nested case statements -- both in the partition by clause and outside the row_number(). For the first column: select t.*, (case when expiry_date > …