Home Forums SQL Server 2008 SQL Server Newbies Row_Number With Partition keep min record of partition when count > 1 RE: Row_Number With Partition keep min record of partition when count > 1

  • Lee Hopkins (6/23/2014)


    just the query to get my counts back by city.

    my problem is i the record i need to keep could be say row 5 of a partition (of 7). so i would need delete 1,2,3,4,6,7 and keep row 5

    Well, since I don't have the data you have I had to make do with what I set up. Take what I did and see what you need to do to make it work with your data.

    If you still have problems, post the DDL and sample data (look at how I did that in my post) and we will see what we can do.