Skip to content

Instantly share code, notes, and snippets.

@KangDroid
Created September 29, 2021 07:45
Show Gist options
  • Save KangDroid/e6d7a4b7ada84c07ac5c525316a05f27 to your computer and use it in GitHub Desktop.
Save KangDroid/e6d7a4b7ada84c07ac5c525316a05f27 to your computer and use it in GitHub Desktop.
SELECT 반환될_채팅_메시지_정보 FROM (
SELECT TOP(50) 채팅_메시지_정보
FROM [채팅_메시지_테이블] AS [c]
WHERE [c].[채팅방_ID] = (찾을_채팅방_ID)
ORDER BY [c].[전송_시각] DESC
) AS [t]
LEFT JOIN [채팅방_참여자_정보] AS [c0] ON [t].[채팅방_참여자_정보_ID] = [c0].[Id]
ORDER BY [t].[전송_시각] DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment