SQL Server select distinct latest values
问题 I have a table that has a ton of rows (>10K). Most of the rows have duplicate role values associated with the username . What I am trying to do is select rows by distinct AND latest role added by request_id . I almost have it, but the part that is kicking my tail is there are null values in some of the request_id fields because those requests were made before that column was added. I STILL need to include them in the select statement in case a user has not entered another request since the