This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- When you need to find the submitted datetime of the second interaction submitted by each and every doc in our database | |
LEFT JOIN ( | |
SELECT * | |
FROM ( | |
SELECT | |
ROW_NUMBER() OVER(PARTITION BY [PhysicianID] ORDER BY [WhenSubmitted]) AS ROW, | |
[PhysicianID], | |
[WhenSubmitted] | |
FROM [dbo].[Recording] | |
) AS tmp |
OlderNewer