Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    you should also tag the database being used Commented Dec 29, 2015 at 14:03
  • how do you want to handle cases where there is a tie, e.g. PK id rows 15-18 (assuming PK id rows 19 and 20 do not exist)? Commented Dec 29, 2015 at 14:05
  • If the newest record's type is 400, do you want that record to be returned, or nothing, so, with your example, for ID 16, do you want to get back the row with PK 19/20 or nothing? Commented Dec 29, 2015 at 14:08
  • Adding some expected output would probably help others to understand what it is that you're trying to achieve. Commented Dec 29, 2015 at 14:13
  • This is a sql server database. Database name is adminstudio. If the newest record is 400 i do not want it to return. What i would like to see returned is just PK and newest date it was at 401 unless its newest date was 400. Hope that helps. Commented Dec 30, 2015 at 15:12